/* Inter Font - Self-hosted for privacy */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/inter-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/inter-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/inter-700.woff2') format('woff2');
}

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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary: #64748b;
    --success: #10b981;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tagline {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 4px;
    background: var(--background);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: var(--text);
    background: var(--surface);
}

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

/* Main Content */
main {
    flex: 1;
    padding: 48px 0;
}

/* Generator Section */
.generator-section {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 64px;
}

/* Type Selector */
.type-selector {
    margin-bottom: 32px;
}

.type-selector h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.type-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.type-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.type-btn svg {
    width: 20px;
    height: 20px;
}

.type-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* Generator Grid */
.generator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 900px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
}

/* Forms */
.qr-form {
    display: none;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.qr-form.active {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--surface);
    color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

select {
    cursor: pointer;
}

/* Password Input */
.password-input-wrapper {
    position: relative;
    display: flex;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--text);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

/* Checkbox */
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

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

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

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--background);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Output Section */
.output-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.qr-preview {
    background: var(--background);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.qr-preview.has-qr {
    border-style: solid;
    background: white;
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-light);
}

.qr-placeholder svg {
    opacity: 0.4;
}

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

#qr-canvas {
    display: none;
}

.qr-preview.has-qr #qr-canvas {
    display: block;
}

.qr-preview.has-qr .qr-placeholder {
    display: none;
}

/* Download Options */
.download-options {
    display: flex;
    gap: 12px;
}

.btn-download {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-download:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-download:nth-child(2) {
    background: var(--secondary);
}

/* Customization */
.customization {
    background: var(--background);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.customization h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.color-options {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-option label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.color-option input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
}

.size-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.size-option label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.size-option input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    cursor: pointer;
    -webkit-appearance: none;
}

.size-option input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow);
}

/* Features Section */
.features {
    padding: 32px 0;
}

.features h2 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Footer */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: auto;
}

footer .container {
    text-align: center;
}

footer p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-note {
    font-size: 0.8rem !important;
    margin-top: 8px;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.qr-preview.has-qr #qr-canvas {
    animation: fadeIn 0.3s ease;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .generator-section {
        padding: 20px;
    }

    .type-btn span {
        display: none;
    }

    .type-btn {
        padding: 12px;
    }

    .type-btn svg {
        width: 24px;
        height: 24px;
    }

    .color-options {
        flex-direction: column;
        gap: 12px;
    }

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

    main {
        padding: 24px 0;
    }

    .features h2 {
        font-size: 1.4rem;
    }
}

/* Print styles */
@media print {
    header, footer, .type-selector, .input-section, .download-options, .customization, .features {
        display: none;
    }

    .generator-section {
        box-shadow: none;
        padding: 0;
    }

    .generator-grid {
        display: block;
    }

    .qr-preview {
        border: none;
        min-height: auto;
    }
}
