@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* MAJESTIC DARK MODE - Official Cyber-Pirate Theme (Primary) */
    --bg-color: #0A0A0A;                  /* obsidian black base for depth */
    --surface: #121414;                   /* core dark surface */
    
    /* Tonal Layers (No-Line Principle) */
    --surface-lowest: #0c0f0f;
    --surface-low: #1a1c1c;
    --surface-container: #1e2020;
    --surface-high: #282a2b;
    --surface-highest: #333535;
    
    /* Interactive & Branding Accents */
    --primary: #f2ca50;                   /* Royal Gold */
    --primary-hover: #ffe088;             /* Bright Gold */
    --primary-container: #d4af37;         /* Deep Gold */
    --on-primary: #3c2f00;                /* Contrast text over gold */
    --on-primary-container: #554300;
    
    --secondary: #ffb3af;                 /* Soft Carmine */
    --secondary-container: #970118;       /* Lacquered Red */
    --on-secondary-container: #ff9e99;
    
    --error: #ffb4ab;
    --error-container: #93000a;
    
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.1);
    
    /* Text variables */
    --text-main: #e2e2e2;                 /* High readability silver-white */
    --text-muted: #d0c5af;                /* Antique parchment-grey */
    --text-dark: #0A0A0A;
    
    /* Borders & Dividers */
    --outline: #99907c;
    --outline-variant: #4d4635;
    --divider: rgba(212, 175, 55, 0.15);  /* Subtle gold divider */
    
    /* Shadow & Glass Effects */
    --shadow-main: 0 16px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 25px rgba(212, 175, 55, 0.2);
    --shadow-glow-active: 0 0 35px rgba(212, 175, 55, 0.35);
    --glass-bg: rgba(26, 28, 28, 0.75);
    
    /* Border Radii (Soft (1) shapes system) */
    --radius-sm: 4px;                     /* Buttons, Inputs, Badges */
    --radius-lg: 8px;                     /* Cards, Containers, Grids */
}

body.light-theme {
    /* EDITORIAL LIGHT MODE - Parchment & Aged Gold (Dynamic Fallback) */
    --bg-color: #FDFCFA;                  /* Soft ivory white */
    --surface: #FFFFFF;                   /* Pure white surface */
    
    /* Tonal Layers (No-Line Principle) */
    --surface-lowest: #F5F4F0;
    --surface-low: #EFECE6;
    --surface-container: #E7E3D9;
    --surface-high: #DDD9CE;
    --surface-highest: #D0CBBF;
    
    /* Accents */
    --primary: #C9A43B;                   /* Antique gold */
    --primary-hover: #b08d2c;
    --primary-container: #e6c567;
    --on-primary: #FFFFFF;
    
    --secondary: #A61B1B;
    --secondary-container: #ffdad7;
    --on-secondary-container: #410002;
    
    --text-main: #1A1A1A;                 /* Deep charcoal */
    --text-muted: #5A5852;                /* Muted charcoal */
    
    --divider: rgba(201, 164, 59, 0.25);
    --shadow-main: 0 16px 40px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 25px rgba(201, 164, 59, 0.15);
    --shadow-glow-active: 0 0 35px rgba(201, 164, 59, 0.25);
    --glass-bg: rgba(255, 255, 255, 0.85);
}

/* ============================================================
   1. GLOBAL RESET & BASE STYLES
   ============================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    position: relative;
}

/* Premium Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--surface-low);
    border-radius: var(--radius-sm);
    border: 2px solid var(--bg-color);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-container);
}

/* Animated Cyber-Pirate Network Lattice (Atmospheric drift background) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 1px 1px, var(--divider) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.25;
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.4s ease;
}

body.light-theme::before {
    opacity: 0.15;
}

/* ============================================================
   2. APP CONTAINER & GRID SYSTEM
   ============================================================ */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }
}

/* ============================================================
   3. APPRECIABLE HEADER & BRAND ALIGNMENT
   ============================================================ */
.app-header {
    margin-bottom: 40px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.brand-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    text-align: left;
    width: 100%;
    max-width: 800px;
}

.app-logo {
    height: 120px;                     /* Increased logo size to visually balance the large title! */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.4));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.brand-container:hover .app-logo {
    transform: rotate(-10deg) scale(1.08);
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;               /* Perfectly center the text elements horizontally! */
    text-align: center;                /* Symmetrical text alignment */
}

.brand-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    margin: 0;
}

.brand-slogan {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-top: 6px;
}

.hero-description-banner {
    margin-top: 18px;
    padding: 14px 24px;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-lg);
    color: var(--text-main);
    font-size: 0.92rem;
    line-height: 1.6;
    width: 100%;
    max-width: 800px;                   /* Aligned with brand-container max-width */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    text-align: center;
}

body.light-theme .hero-description-banner {
    background: rgba(201, 164, 59, 0.05);
    border: 1px solid rgba(201, 164, 59, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.hero-description-banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(212, 175, 55, 0.4);
}

.hero-description-banner strong {
    color: var(--primary);
    font-weight: 700;
    display: block;                     /* Own line, no inline spacing tricks */
    margin-bottom: 6px;
    font-size: 1.05em;
}

/* Control the spacing of lines inside the hero banner via br */
.hero-description-banner br + br {
    display: none;                      /* Hide double <br> — spacing handled by line-height */
}

/* The third line (last phrase) gets a subtle top margin via CSS instead of <br><br> */
.hero-description-banner .hero-last-line {
    display: block;
    margin-top: 8px;
    font-style: italic;
    opacity: 0.85;
}

@media (max-width: 600px) {
    .brand-container {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    .brand-title {
        font-size: 2.0rem;
    }
    .brand-slogan {
        font-size: 0.85rem;
    }
    .app-logo {
        height: 80px;                  /* Scaled appropriately for mobile screens */
    }
}

/* ============================================================
   4. NAVIGATION HEADER ACTIONS (LANGS, THEME)
   ============================================================ */
.header-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

/* Theme Toggle Trigger button */
.theme-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.825rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    box-shadow: var(--shadow-main);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-btn:hover {
    background: var(--surface-low);
    color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.theme-btn .header-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.5px;
    color: var(--primary);
}

/* 🏴‍☠️ Glassmorphic Custom Language Dropdown */
.lang-dropdown {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    color: var(--text-main);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-main);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-btn:hover {
    background: var(--surface-low);
    box-shadow: var(--shadow-glow);
}

.lang-btn .chevron {
    transition: transform 0.25s ease;
    stroke: var(--primary);
}

.lang-dropdown.active .lang-btn .chevron {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    padding: 6px;
    min-width: 150px;
    z-index: 1000;
    box-shadow: var(--shadow-main);
    border: 1px solid var(--divider);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-dropdown.active .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.825rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--primary);
}

.lang-option.active {
    background: rgba(212, 175, 55, 0.25);
    color: var(--primary);
    font-weight: 700;
}

.flag-icon {
    width: 18px;
    height: 12px;
    border-radius: 1px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   5. PREMIUM TACTILE DRAG & DROP ZONE
   ============================================================ */
.upload-zone {
    background: var(--surface);
    border: 2px dashed var(--divider);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(242, 202, 80, 0.03) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-active);
}

.upload-zone:hover::before {
    opacity: 1;
}

.upload-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-content svg {
    color: var(--primary);
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.upload-zone:hover .upload-content svg {
    transform: translateY(-6px) scale(1.1);
}

.upload-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.upload-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================================
   6. DECORATIVE SAILING ATMOSPHERE (PIRATE HELM)
   ============================================================ */
.ship-animation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px 0 24px 0;
}

.pirate-helm-svg {
    width: 80px;                       /* Increased size from 60px for premium presence */
    height: 80px;
    color: var(--primary);             /* Solid bright gold primary color instead of transparent divider */
    opacity: 0.9;                      /* High crisp visibility */
    animation: steer-sway 8s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

@keyframes steer-sway {
    0% { transform: rotate(-12deg) scale(0.98); }
    50% { transform: rotate(12deg) scale(1.02); }
    100% { transform: rotate(-12deg) scale(0.98); }
}

/* ============================================================
   RESULTS READY INDICATOR (Scroll-down hint, post-upload)
   ============================================================ */
.results-ready-indicator {
    display: none;                      /* Hidden until file is processed */
    text-align: center;
    margin: -8px 0 8px 0;
    animation: fade-in-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.results-ready-indicator.visible {
    display: block;
}

.results-ready-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 28px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.results-ready-inner:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: translateY(2px);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.15);
}

.results-ready-check {
    display: none;                      /* Removed — redundant with arrows */
}

.results-ready-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.02em;
    white-space: nowrap;
    opacity: 0.9;
}

.scroll-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 2px;
}

.scroll-arrows svg {
    color: var(--primary);
    opacity: 0.8;
    animation: bounce-down 1.2s ease-in-out infinite;
    margin-top: -8px;
}

.scroll-arrows svg:nth-child(2) {
    animation-delay: 0.2s;
    opacity: 0.4;
}

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(5px); }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SUCCESS TOAST NOTIFICATION (top banner, auto-dismiss)
   ============================================================ */
.success-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 9999;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
    opacity: 0;
    pointer-events: none;
}

.success-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.success-toast-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 50px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 175, 55, 0.15);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.success-toast-inner svg {
    flex-shrink: 0;
    color: var(--primary);
}



/* ============================================================
   7. STRUCTURAL DATA CARDS (NO-LINE PRINCIPLE)
   ============================================================ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-main);
    position: relative;
    overflow: hidden;
    border: none;                     /* NO harsh standard borders */
}

/* Subtle Royal Gold watermark details for headers */
.card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--divider);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
    margin-top: -12px;
}

/* ============================================================
   8. DYNAMIC RESULTS PANEL & COPYABLE DATA FIELDS
   ============================================================ */
.results-container {
    animation: slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Action Header bar inside results (Print/DL buttons) */
.actions-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}
.actions-header #btn-print {
    justify-self: end;
}
.actions-header #btn-download-json {
    justify-self: start;
}

/* Custom copyable grid fields */
.copyable-field {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

.copyable-field label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.field-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-lowest);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    border: 1px solid transparent;     /* Seamless until interactive focus */
}

.field-content:hover {
    background: var(--surface-low);
    border-color: var(--divider);
}

.field-val-container {
    flex: 1;
    min-width: 0;
}

.field-content span {
    font-size: 0.95rem;
    font-weight: 600;
    word-break: break-all;
}

/* Dynamic pill tags inside panels */
.badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(242, 202, 80, 0.12);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.doc-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-left: 8px;
    vertical-align: middle;
}

.badge-avoir {
    background: var(--secondary-container) !important;
    color: var(--secondary) !important;
}

.badge-remboursement {
    background: rgba(37, 99, 235, 0.15) !important;
    color: #60a5fa !important;
}

.badge-agl {
    background: var(--secondary-container) !important;
    color: var(--secondary) !important;
    box-shadow: 0 0 10px rgba(151, 1, 24, 0.4);
}

/* Extracted Amounts Matrix */
.amounts-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

@media (max-width: 480px) {
    .amounts-container {
        grid-template-columns: 1fr;
    }
}

.amount-box .field-content {
    padding: 12px;
}

.amount-box .field-content span {
    font-size: 1.15rem;
    font-weight: 800;
}

.highlight {
    color: var(--success) !important;
    font-weight: 700 !important;
}

.action-alert {
    color: var(--primary) !important;
    font-weight: 700 !important;
}

/* Symmetrical amounts comparison detail box */
.dougs-mapping .amounts-container {
    background: var(--surface-lowest);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 20px;
}

#dougs-input-val {
    color: #6ee7b7 !important;         /* vibrant modern success */
    font-size: 1.25rem;
}

#dougs-input-tva {
    color: #fca5a5 !important;         /* high-end warning tone */
    font-size: 1.25rem;
}

.conversion-note {
    font-size: 0.725rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--divider);
    line-height: 1.3;
}

/* Grid Layout for Desktop Dashboard */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

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

/* ============================================================
   9. STRUCTURED TERMINAL CODES & SUMMARY BOX
   ============================================================ */
textarea {
    width: 100%;
    height: 240px;
    background: var(--surface-lowest);
    border: 1px solid var(--surface-high);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: none;
    margin-bottom: 12px;
    outline: none;
    transition: all 0.25s ease;
}

textarea:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

pre {
    background: var(--surface-lowest);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-high);
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    max-height: 200px;
    overflow-y: auto;
}

/* ============================================================
   10. BUTTONS & CONTROLS (THE BOUNTY GLOW)
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);  /* 4px */
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

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

.btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-active);
}

.btn.primary:active {
    transform: translateY(0);
}

.btn.secondary {
    background-color: var(--surface-low);
    color: var(--text-main);
    border: 1px solid var(--divider);
}

.btn.secondary:hover {
    background-color: var(--surface-container);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.btn.small {
    padding: 6px 12px;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

/* Copy buttons with icons styling */
.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    color: var(--primary);
    background: rgba(242, 202, 80, 0.12);
}

.copied-text {
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--success);
    animation: text-pulse 0.3s ease;
}

@keyframes text-pulse {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* ============================================================
   11. ADVERTISING PLACEHOLDERS (Subtle Glass panels)
   ============================================================ */
.adsense-slot {
    text-align: center;
    border: 1.5px dashed var(--divider) !important;
    background: rgba(242, 202, 80, 0.02) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: none !important;
    padding: 8px !important;
    margin: 16px 0 !important;
    max-height: 100px !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ad-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    opacity: 0.5;
    margin-bottom: 6px;
}

.ad-placeholder-text {
    font-size: 0.725rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 6px;
}

/* ============================================================
   12. HISTORICAL COMPASS & ACCORDION FAQ ITEMS
   ============================================================ */
/* Black Bart Story Panel */
.story-section {
    border: 1px solid var(--divider);
}

.story-container {
    padding: 8px 4px;
}

.story-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.story-decor-left {
    flex-shrink: 0;
}

.golden-compass-svg {
    width: 72px;
    height: 72px;
    color: var(--primary);
    animation: rotate-compass 35s linear infinite;
    filter: drop-shadow(0 0 10px rgba(242, 202, 80, 0.25));
}

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

.story-text-container {
    flex-grow: 1;
}

.story-paragraph {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

@media (max-width: 600px) {
    .story-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

/* Dynamic FAQ items */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    background: var(--surface-lowest);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.faq-item:hover {
    border-color: var(--divider);
}

.faq-question {
    width: 100%;
    background: transparent;
    border: none;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.925rem;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.faq-question:hover {
    background: rgba(242, 202, 80, 0.03);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), padding 0.3s ease;
}

.faq-item.active {
    border-color: var(--divider);
    background: var(--surface-low);
}

.faq-item.active .faq-answer {
    max-height: 800px;
    padding: 0 20px 20px 20px;
    border-top: 1px dashed var(--divider);
    padding-top: 12px;
}

.faq-question .chevron {
    color: var(--primary);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.active .faq-question .chevron {
    transform: rotate(180deg);
}

/* ============================================================
   13. SUGGESTIONS FORM (INTERACTION AND SUBMITS)
   ============================================================ */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group-row {
    display: flex;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-group-row {
        flex-direction: column;
        gap: 16px;
    }
}

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

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input, .form-group select, .form-group textarea {
    background: var(--surface-lowest);
    border: 1px solid var(--surface-low);
    border-radius: var(--radius-sm);   /* 4px */
    color: var(--text-main);
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.25s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    background: var(--surface-low);
    box-shadow: var(--shadow-glow);
}

.feedback-success-msg {
    animation: slide-up 0.4s ease-out;
}

.success-box {
    text-align: center;
    padding: 32px 16px;
    background: var(--success-bg);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.success-icon {
    color: var(--success);
    margin-bottom: 12px;
}

.success-box h3 {
    color: var(--success);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.success-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ============================================================
   14. AFFILIATE PARTNERS DIRECTORY (TRANSITIONS & EFFECTS)
   ============================================================ */
.partners-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.partners-column {
    background: var(--surface-lowest);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.partners-column h3 {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--divider);
}

.partner-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.partner-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--radius-sm);  /* 4px */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.partner-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-glow);
}

.partner-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.partner-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.9rem;
}

.partner-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.partner-link {
    background: transparent;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);   /* 4px */
    padding: 6px 12px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.partner-link:hover {
    background: var(--primary);
    color: var(--text-dark);
}

.partner-note {
    font-size: 0.725rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 12px;
    text-align: center;
    opacity: 0.7;
}

/* ============================================================
   15. PREMIUM MODAL CARD OVERLAYS
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    max-width: 680px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.95) translateY(10px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px dashed var(--divider);
}

.modal-title {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--primary);
    background: rgba(242, 202, 80, 0.12);
}

.modal-body-content {
    padding: 24px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-main);
}

.modal-body-content h4 {
    color: var(--primary);
    margin-top: 18px;
    margin-bottom: 6px;
    font-size: 0.95rem;
    font-weight: 700;
}

.modal-body-content p {
    margin-bottom: 12px;
    color: var(--text-muted);
}

.modal-body-content ul {
    margin-bottom: 12px;
    padding-left: 20px;
    color: var(--text-muted);
}

.modal-body-content li {
    margin-bottom: 4px;
}

/* ============================================================
   16. STICKY UTILITIES (SCROLL TOP & DIVISION FOOTERS)
   ============================================================ */
.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    box-shadow: var(--shadow-main);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--text-dark);
    transform: translateY(-2px) scale(1.05);
}

/* App Footer links */
.app-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px dashed var(--divider);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    border-bottom: 1px dashed transparent;
}

.footer-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* PayPal Support Button in Footer */
.paypal-support-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 196, 57, 0.04);
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: 30px;
    padding: 8px 22px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 0 10px rgba(255, 196, 57, 0.05);
}

.paypal-support-btn:hover {
    background: var(--primary);
    color: var(--bg-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 196, 57, 0.25);
}

.paypal-support-btn svg {
    transition: transform 0.3s ease;
}

.paypal-support-btn:hover svg {
    transform: scale(1.1);
}

/* AdBlock Locker Overlay */
.adblock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.adblock-card {
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 196, 57, 0.1);
    animation: adblock-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes adblock-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.adblock-icon-container {
    margin-bottom: 20px;
}

.adblock-icon {
    filter: drop-shadow(0 0 8px rgba(255, 196, 57, 0.3));
    color: var(--primary);
}

.adblock-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.adblock-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.adblock-reasons {
    background: var(--surface-lowest);
    border: 1px dashed var(--divider);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
    text-align: left;
}

.adblock-reason {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-main);
}

.adblock-reason:last-child {
    margin-bottom: 0;
}

.adblock-reason strong {
    color: var(--primary);
}

.adblock-reason .reason-icon {
    font-size: 1.1rem;
    line-height: 1.2;
}

.adblock-btn {
    background: var(--primary);
    color: var(--bg-color) !important;
    border: none;
    border-radius: 8px;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 196, 57, 0.2);
    width: 100%;
}

.adblock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 196, 57, 0.35);
    filter: brightness(1.1);
}

.adblock-btn:active {
    transform: translateY(0);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-5px); }
    30%, 60%, 90% { transform: translateX(5px); }
}

/* ============================================================
   17. HIGH CONTRAST MEDIA PRINT SPECIFICATIONS
   ============================================================ */
/* Mobile Optimization for Action Buttons */
@media (max-width: 600px) {
    .actions-header {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    .actions-header .btn {
        width: 100%;
    }
}

@media print {
    :root {
        --bg-color: #ffffff !important;
        --surface: #ffffff !important;
        --surface-lowest: #f9f9f9 !important;
        --text-main: #000000 !important;
        --text-muted: #333333 !important;
        --primary: #000000 !important;
        --divider: #666666 !important;
    }
    
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .app-container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .app-header {
        border: 1px solid #000000 !important;
        box-shadow: none !important;
        padding: 12px !important;
        margin-bottom: 1cm !important;
    }
    
    .brand-title {
        color: #000000 !important;
        text-shadow: none !important;
    }
    
    .upload-zone, 
    .no-print, 
    .copy-btn, 
    .btn, 
    .raw-text, 
    #history-container, 
    .faq-section,
    .header-actions,
    .scroll-top-btn,
    iframe {
        display: none !important;
    }
    
    .results-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1.2cm !important;
    }
    
    .card {
        border: 1px solid #000000 !important;
        box-shadow: none !important;
        background: #ffffff !important;
        padding: 16px !important;
        page-break-inside: avoid !important;
    }
    
    .field-content {
        background: #f9f9f9 !important;
        border: 1px solid #000000 !important;
    }
    
    textarea {
        border: 1px solid #000000 !important;
        background: #ffffff !important;
        color: #000000 !important;
        height: auto !important;
        min-height: 150px !important;
    }
}
