* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background: rgba(102, 126, 234, 0.3);
    color: #1a1a2e;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #654a8f 100%);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 30px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    /* height: 200%; */
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: 10%;
    right: 5%;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4), 
                0 15px 40px rgba(0, 0, 0, 0.25),
                0 5px 15px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.9),
                0 0 0 1px rgba(102, 126, 234, 0.1);
    max-width: 900px;
    width: 100%;
    padding: 50px;
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 28px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    margin-bottom: 45px;
    padding-bottom: 25px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #667eea, #764ba2, transparent);
    border-radius: 10px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        opacity: 0.5;
        filter: blur(2px);
    }
    50% {
        opacity: 1;
        filter: blur(0px);
    }
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.header h1 {
    color: #1a1a2e;
    font-size: 2.8rem;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: #5a5a6e;
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 30px;
    position: relative;
}

.form-section::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -20px;
    right: -20px;
    bottom: -10px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
    border-radius: 20px;
    pointer-events: none;
    z-index: -1;
}

.input-group {
    margin-bottom: 30px;
    position: relative;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    transform: translateY(-2px);
}

.input-group:focus-within label {
    color: #667eea;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 1rem;
}

.label-icon {
    font-size: 1.2rem;
}

.label-badge {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.label-badge.optional {
    background: linear-gradient(135deg, #a8b3ff 0%, #c4b5fd 100%);
}

.input-hint {
    display: block;
    color: #7c7c8a;
    margin-top: 8px;
    font-size: 0.88rem;
    font-weight: 500;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e8e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafbff;
}

.input-group input[type="text"]:hover {
    border-color: #d0d0e0;
    background: white;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
    background: white;
    transform: translateY(-1px);
}

.input-group input[type="text"]:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.file-upload-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px 20px;
    border: 2px dashed #d0d0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafbff;
    text-align: center;
}

.file-upload-label .upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
    font-weight: 300;
    color: #667eea;
}

.file-upload-label span:not(.upload-icon) {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    margin-bottom: 5px;
}

.file-upload-label small {
    color: #999;
    font-size: 0.85rem;
}

.file-upload-wrapper:hover .file-upload-label {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #fafbff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.logo-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid #667eea;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fafbff 100%);
    min-height: 150px;
}

.logo-preview img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
}

.remove-logo-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
    z-index: 3;
}

.remove-logo-btn:hover {
    background: #ff3838;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

.remove-logo-btn:active {
    transform: scale(0.95);
}

.input-group small {
    display: block;
    color: #999;
    margin-top: 5px;
    font-size: 0.85rem;
}

.customization-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #fafbff 100%);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}

.customization-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.customization-section h3 {
    color: #1a1a2e;
    margin-bottom: 25px;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.customization-section h3::before {
    content: '';
    display: none;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.option {
    padding: 15px;
    background: white;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(102, 126, 234, 0.05);
    animation: fadeInUp 0.5s ease-out backwards;
}

.option:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.2);
}

.option:nth-child(1) { animation-delay: 0.05s; }
.option:nth-child(2) { animation-delay: 0.1s; }
.option:nth-child(3) { animation-delay: 0.15s; }
.option:nth-child(4) { animation-delay: 0.2s; }
.option:nth-child(5) { animation-delay: 0.25s; }
.option:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.option-icon {
    font-size: 1.1rem;
}

.option input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid #e8e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option input[type="color"]:hover {
    border-color: #667eea;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.option select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8e8f0;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

.option select:hover {
    border-color: #d0d0e0;
}

.option select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.option select:focus-visible,
.option input[type="color"]:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.range-wrapper {
    display: flex;
    align-items: center;
    gap: 12px; 
.option input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 10px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    -webkit-appearance: none;
}}

.option input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    border: 3px solid #667eea;
    transition: all 0.3s ease;
}

.option input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.option input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    border: 3px solid #667eea;
    transition: all 0.3s ease;
}

.range-value {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
    min-width: 45px;
    text-align: center;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
}

.option small {
    display: block;
    color: #7c7c8a;
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 500;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #e8e8f0;
    border-radius: 6px;
    background: white;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label:hover .checkbox-custom {
    border-color: #667eea;
    transform: scale(1.05);
}

.checkbox-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #333;
}

.generate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.generate-btn .btn-icon {
    display: none;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

.generate-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.generate-btn.loading .btn-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.result-section {
    text-align: center;
    margin-top: 40px;
    padding-top: 35px;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    margin-bottom: 25px;
}

.result-header h3 {
    animation: successBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

@keyframes successBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.result-section h3 {
    color: #1a1a2e;
    margin-bottom: 8px;
    font-size: 1.8rem;
    font-weight: 700;
}

.result-subtitle {
    color: #5a5a6e;
    font-size: 1rem;
    font-weight: 500;
}

.result-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.result-footer small {
    color: #7c7c8a;
    font-size: 0.9rem;
    font-weight: 500;
}

.qr-container {
    display: inline-block;
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12),
                0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.qr-container::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qr-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15),
                0 10px 20px rgba(0, 0, 0, 0.1),
                0 0 40px rgba(102, 126, 234, 0.2);
}

.qr-container:hover::after {
    opacity: 0.1;
}

.qr-container canvas,
.qr-container img {
    display: block;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 14px 35px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn .btn-icon {
    display: none;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.download-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.download-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.5);
}

.copy-btn {
    background: linear-gradient(135deg, #2196F3 0%, #0b7dda 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #0b7dda 0%, #0960b8 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.5);
}

@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }

    .container {
        padding: 30px 25px;
        border-radius: 20px;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .customization-section {
        padding: 25px 20px;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .qr-container {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 25px 20px;
        border-radius: 20px;
    }
    
    .generate-btn {
        font-size: 1rem;
        padding: 16px;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .option:hover {
        transform: none;
    }
    
    .generate-btn:hover {
        transform: translateY(0);
    }
    
    .action-btn:hover {
        transform: translateY(0);
    }
    
    .qr-container:hover {
        transform: none;
    }
}

/* Watermark styling */
.watermark {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    font-size: 0.9rem;
    color: #5a5a6e;
    font-weight: 500;
}

.watermark a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.watermark a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.watermark a:hover {
    color: #764ba2;
}

.watermark a:hover::after {
    width: 100%;
}
