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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-color: #f7fafc;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 40px;
    width: auto;
    max-width: 200px;
}

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

.nav-link {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #2b6cb0;
}

/* Main Content */
.main {
    min-height: calc(100vh - 80px);
}

/* Ad Zones */
.ad-zone {
    min-height: 90px;
    background: #f1f5f9;
    border: 2px dashed #cbd5e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    border-radius: 8px;
    color: #718096;
    font-size: 0.875rem;
}

.ad-zone--header {
    margin-top: 0;
}

.ad-zone--footer {
    margin-bottom: 0;
}

/* Generator Section */
.generator-section {
    padding: 3rem 0;
    background: #ffffff;
}

.generator-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
}

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

/* Input Panel */
.input-panel {
    background: #f7fafc;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.input-group {
    margin-bottom: 2rem;
}

.input-label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qr-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.qr-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.input-help {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #718096;
}

.char-count {
    font-weight: 500;
}

/* Customization Panel */
.customization-panel {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #718096;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: help;
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.range-input {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 0.5rem;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #3182ce;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3182ce;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-value {
    display: block;
    text-align: center;
    font-weight: 600;
    color: #3182ce;
    font-size: 0.875rem;
}

.color-input {
    width: 60px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.select-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.select-input:focus {
    outline: none;
    border-color: #3182ce;
}

/* Preview Panel */
.preview-panel {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.qr-preview {
    position: relative;
    margin-bottom: 2rem;
}

.qr-code-container {
    display: inline-block;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #718096;
    font-size: 0.875rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Download Panel */
.download-panel {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
    min-width: 140px;
}

.btn--primary {
    background: #3182ce;
    color: white;
}

.btn--primary:hover:not(:disabled) {
    background: #2c5aa0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(49, 130, 206, 0.3);
}

.btn--secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn--secondary:hover:not(:disabled) {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

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

.size-presets {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.presets-label {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

.preset-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid #cbd5e0;
    background: white;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: #3182ce;
    color: #3182ce;
}

.preset-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

/* Guide Section */
.guide-section {
    padding: 4rem 0;
    background: #f7fafc;
}

.guide-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.guide-step {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.guide-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #3182ce;
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.step-description {
    color: #718096;
    line-height: 1.6;
}

.subsection-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
}

.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.use-case {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3182ce;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.use-case h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.use-case p {
    color: #718096;
    font-size: 0.875rem;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: white;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid #e2e8f0;
}

.faq-question {
    width: 100%;
    padding: 1.5rem 0;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: #3182ce;
}

.faq-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer.open {
    max-height: 200px;
    padding-bottom: 1.5rem;
}

.faq-answer p {
    color: #718096;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #2d3748;
    color: #e2e8f0;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
    color: #cbd5e0;
    font-size: 0.875rem;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #4a5568;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.stats {
    font-size: 0.875rem;
    color: #cbd5e0;
}

.stats strong {
    color: #3182ce;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.donate-link {
    color: #ffd700;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid #ffd700;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.donate-link:hover {
    background: #ffd700;
    color: #2d3748;
    transform: translateY(-1px);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2d3748;
    color: white;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Responsive Design */
@media (min-width: 640px) {
    .container {
        padding: 0 2rem;
    }
    
    .guide-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
    
    .download-buttons {
        flex-wrap: nowrap;
    }
}

@media (min-width: 768px) {
    .generator-layout {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    .nav {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .generator-layout {
        grid-template-columns: 1.2fr 0.8fr;
    }
    
    .container {
        padding: 0 3rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .ad-zone,
    .cookie-banner {
        display: none;
    }
    
    .main {
        margin: 0;
        padding: 0;
    }
    
    .qr-code-container {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn--primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .btn--secondary {
        background: #fff;
        border: 2px solid #000;
        color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.qr-input:focus,
.range-input:focus,
.color-input:focus,
.select-input:focus,
.faq-question:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

/* Error States */
.qr-input.error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.error-message {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Success States */
.success-message {
    color: #38a169;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Dark mode support (system preference) */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
    
    /* Note: Full dark mode implementation would go here */
    /* For now, respecting system preference for form controls */
}