/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 2rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

.generator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Config Panel */
.config-panel,
.preview-panel {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

/* QR Types */
.qr-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.qr-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.qr-type-btn i {
    font-size: 1.5rem;
    color: var(--gray-500);
    transition: var(--transition);
}

.qr-type-btn:hover {
    background: var(--gray-100);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.qr-type-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.qr-type-btn.active i {
    color: var(--white);
}

/* QR Mode */
.qr-mode {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.radio-label:hover {
    border-color: var(--primary-light);
    background: var(--gray-100);
}

.radio-label input[type="radio"] {
    margin-top: 0.25rem;
}

.radio-label span {
    font-weight: 600;
    display: block;
    color: var(--gray-700);
}

.radio-label small {
    display: block;
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.radio-label input[type="radio"]:checked + span {
    color: var(--primary-color);
}

/* Content Forms */
.content-form {
    display: none;
}

.content-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* Customize */
.customize-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.color-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.color-input {
    width: 60px;
    height: 44px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
}

.color-text {
    flex: 1;
    text-transform: uppercase;
}

.range-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    outline: none;
    -webkit-appearance: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-input {
    display: none;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--gray-600);
}

.file-label:hover {
    background: var(--gray-100);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.logo-preview {
    margin-top: 1rem;
    position: relative;
    display: inline-block;
}

.logo-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
}

.btn-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--danger-color);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-large {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
}

.btn-download {
    flex: 1;
    background: var(--secondary-color);
    color: var(--white);
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Preview Panel */
.preview-card {
    position: sticky;
    top: 100px;
}

.qr-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.qr-placeholder {
    text-align: center;
    color: var(--gray-400);
}

.qr-placeholder i {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.qr-placeholder p {
    font-size: 1.125rem;
}

#qr-preview img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

/* Download Section */
.download-section {
    margin-top: 2rem;
}

.download-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.download-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

/* Dynamic Info */
.dynamic-info {
    margin-top: 2rem;
}

.info-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.info-box h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.info-box p {
    margin-bottom: 0.75rem;
    opacity: 0.95;
}

.info-box ul {
    list-style: none;
    margin-bottom: 1.25rem;
}

.info-box li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.info-box li:before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.dynamic-links {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.link-group {
    margin-bottom: 1rem;
}

.link-group:last-child {
    margin-bottom: 0;
}

.link-group label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.copy-input {
    display: flex;
    gap: 0.5rem;
}

.copy-input input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 0.875rem;
}

.btn-copy {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Features Info */
.features-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-item i {
    color: var(--secondary-color);
    font-size: 1.25rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    color: var(--white);
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    margin-top: 1rem;
    font-size: 1.125rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--gray-800);
    color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    transform: translateY(150%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

.toast.success {
    background: var(--secondary-color);
}

.toast.error {
    background: var(--danger-color);
}

/* Footer */
.footer {
    background: var(--gray-800);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .generator-wrapper {
        grid-template-columns: 1fr;
    }

    .preview-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .qr-types {
        grid-template-columns: repeat(2, 1fr);
    }

    .customize-grid {
        grid-template-columns: 1fr;
    }

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

    .nav {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.25rem;
    }

    .logo i {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .config-panel,
    .preview-panel {
        padding: 1.25rem;
    }

    .qr-types {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .qr-type-btn {
        padding: 0.75rem;
        font-size: 0.75rem;
    }

    .qr-type-btn i {
        font-size: 1.25rem;
    }
}
