/* Cannabis Product Analysis - Professional Web Interface */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* ========================================================================
       SEDATION-ENERGY SPECTRUM COLOR PALETTE
       Navy (Sedating/Indica) → Grey (Balanced) → Orange (Energizing/Sativa)
       ======================================================================== */

    /* Primary Spectrum Colors */
    --primary-navy: #112E51;      /* Strong Indica - Most Sedating */
    --primary-grey: #78909C;      /* Balanced - Neutral */
    --primary-orange: #FF7043;    /* Strong Sativa - Most Energizing */

    /* Legacy alias for backward compatibility */
    --primary-teal: #FF8A65;      /* Now maps to Moderate Sativa orange */

    /* Sequential Navy (Indica/Sedating Side) */
    --navy-50: #0d1321;
    --navy-100: #111d2e;
    --navy-200: #BBDEFB;
    --navy-300: #90CAF9;
    --navy-400: #64B5F6;
    --navy-500: #42A5F5;
    --navy-600: #2E5984;          /* Moderate Indica */
    --navy-700: #1E4976;
    --navy-800: #163A5F;
    --navy-900: #112E51;          /* Strong Indica */

    /* Sequential Grey (Balanced/Neutral) */
    --grey-50: #FAFAFA;
    --grey-100: #F5F5F5;
    --grey-200: #EEEEEE;
    --grey-300: #E0E0E0;
    --grey-400: #BDBDBD;
    --grey-500: #78909C;          /* Balanced - Primary */
    --grey-600: #607D8B;
    --grey-700: #546E7A;
    --grey-800: #455A64;
    --grey-900: #37474F;

    /* Sequential Orange (Sativa/Energizing Side) */
    --orange-50: #FFF8E1;
    --orange-100: #FFECB3;
    --orange-200: #FFE082;
    --orange-300: #FFB74D;        /* Mild Sativa */
    --orange-400: #FFA726;
    --orange-500: #FF8A65;        /* Moderate Sativa */
    --orange-600: #FF7043;        /* Strong Sativa */
    --orange-700: #F4511E;
    --orange-800: #E64A19;
    --orange-900: #BF360C;

    /* Spectrum Gradient Stops - 21 levels from -10 to +10 */
    /* Sedating (-10 to -4): Deep navy blues */
    --spectrum-sedating-10: #0A1929;
    --spectrum-sedating-9: #0D2137;
    --spectrum-sedating-8: #112E51;
    --spectrum-sedating-7: #163A5F;
    --spectrum-sedating-6: #1B4672;
    --spectrum-sedating-5: #215285;
    --spectrum-sedating-4: #2E5984;
    /* Mildly Sedating (-3 to -1): Lighter blues */
    --spectrum-mildly-sedating-3: #3D6A94;
    --spectrum-mildly-sedating-2: #4A7BA7;
    --spectrum-mildly-sedating-1: #5B8DB8;
    /* Balanced (0): Grey */
    --spectrum-balanced: #78909C;
    /* Mildly Energizing (+1 to +3): Yellow/Light orange */
    --spectrum-mildly-energizing-1: #D4A84B;
    --spectrum-mildly-energizing-2: #E8B339;
    --spectrum-mildly-energizing-3: #FFB74D;
    /* Energizing (+4 to +10): Orange gradient */
    --spectrum-energizing-4: #FFA726;
    --spectrum-energizing-5: #FF9800;
    --spectrum-energizing-6: #FF8A65;
    --spectrum-energizing-7: #FF7043;
    --spectrum-energizing-8: #F4511E;
    --spectrum-energizing-9: #E64A19;
    --spectrum-energizing-10: #D84315;

    /* Legacy aliases for backward compatibility */
    --spectrum-indica-strong: #112E51;
    --spectrum-indica-moderate: #2E5984;
    --spectrum-indica-mild: #4A7BA7;
    --spectrum-sativa-mild: #FFB74D;
    --spectrum-sativa-moderate: #FF8A65;
    --spectrum-sativa-strong: #FF7043;

    /* Legacy Teal aliases - Map to spectrum colors for backward compatibility */
    --teal-50: #FFF8E1;           /* Maps to orange-50 */
    --teal-100: #FFECB3;          /* Maps to orange-100 */
    --teal-200: #FFE082;          /* Maps to orange-200 */
    --teal-300: #FFB74D;          /* Maps to orange-300 (Mild Sativa) */
    --teal-400: #FFA726;          /* Maps to orange-400 */
    --teal-500: #FF8A65;          /* Maps to orange-500 (Moderate Sativa) */
    --teal-600: #FF7043;          /* Maps to orange-600 (Strong Sativa) */
    --teal-700: #F4511E;          /* Maps to orange-700 */
    --teal-800: #E64A19;          /* Maps to orange-800 */
    --teal-900: #BF360C;          /* Maps to orange-900 */

    /* Functional Colors — Dark Theme (matches graph page) */
    --background: #0a0e17;
    --background-alt: #0d1321;
    --background-elevated: #111827;
    --text-primary: #c8d6e5;
    --text-secondary: #8b9bb5;
    --text-muted: #636e82;
    --border-color: #2a3a5c;
    --border-strong: #3a5080;
    --success-color: #34d399;
    --error-color: #f87171;
    --warning-color: #fbbf24;

    /* Shadows - Dark theme */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

/* Global dark scrollbars */
* {
    scrollbar-color: #2a3a5c #0d1321;
    scrollbar-width: thin;
}
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0d1321;
}
::-webkit-scrollbar-thumb {
    background: #2a3a5c;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3b4f6e;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 153px; /* Space for fixed header with larger logo */
    letter-spacing: -0.011em;
    overflow-x: hidden; /* Prevent horizontal scroll from 100vw header */
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 32px;
}

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

/* ============================================================================
   HEADER - Clean Compact Design
   ============================================================================ */

/* Ensure consistent spacing for the shared header container */
#shared-header {
    margin-bottom: 0;
    min-height: 0;
    background: linear-gradient(135deg, #0d1321 0%, #1a1f35 100%);
    position: relative;
    z-index: 1000;
}

/* In scroll mode the header is relative, so the placeholder needs height */
html.header-scroll-pending #shared-header,
body.header-scroll #shared-header {
    min-height: 143px;
    margin-bottom: 20px;
}

/* When header is inside a container with padding, adjust spacing */
.container > #shared-header:first-child {
    margin-top: 0;
}

.container > #shared-header:first-child header {
    margin-top: 0;
}

/* Fixed header - sticks to top of viewport (default) */
header {
    background: linear-gradient(135deg, #0d1321 0%, #1a1f35 100%);
    color: #c8d6e5;
    padding: 10px 32px 14px 10px;
    border-radius: 0;
    /* Full viewport width */
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid #2a3a5c;
    /* Fixed height to prevent layout shift */
    min-height: 143px;
    box-sizing: border-box;
}

/* Scrollable header mode - header scrolls with page */
/* Uses both html and body class for early application before body exists */
html.header-scroll-pending body,
body.header-scroll {
    padding-top: 0 !important;
}

html.header-scroll-pending header,
body.header-scroll header {
    position: relative !important;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: -24px;
    box-shadow: none;
    border-bottom: 1px solid #2a3a5c;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 82px;  /* Accommodate larger logo */
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 160px;  /* Prevent layout shift */
    flex-shrink: 0;
}

.header-brand a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.header-brand a:hover {
    opacity: 0.85;
}

.header-brand a:hover .header-logo {
    transform: scale(1.05);
}

.header-logo {
    height: 82px;
    width: auto;
    transition: transform 0.2s;
    border-radius: 12px;
}

header h1 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #7fb5d5;
}

.subtitle {
    display: none;
}

/* State Display - In Stats Row */
.hero-stat-state {
    margin-right: 4px;
    padding-right: 10px;
    border-right: 1px solid #2a3a5c;
    min-width: 160px;
    width: 160px;
    flex-shrink: 0;
}

.hero-stat-state .state-value {
    font-size: 1rem;
    font-weight: 700;
    color: #c8d6e5;
    width: 100%;       /* Fill parent width */
    text-align: left;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* State Selector Dropdown */
.state-selector {
    background: #1a2744;
    color: #c8d6e5;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #2a3a5c;
    border-radius: 4px;
    padding: 4px 8px;
    width: 100%;
    cursor: pointer;
    outline: none;
    appearance: none;  /* Remove default browser styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Add custom dropdown arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c8d6e5' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 24px;  /* Make room for arrow */
}

.state-selector:hover {
    background: #243b63;
}

.state-selector:focus {
    border-color: #8b9bb5;
    box-shadow: 0 0 0 2px rgba(139, 155, 181, 0.2);
}

/* Style the dropdown options */
.state-selector option {
    background: #1a2744;
    color: #c8d6e5;
    padding: 4px;
}

/* Compact Stats Row */
.hero-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;  /* Prevent wrapping to avoid vertical shift */
    min-height: 24px;  /* Prevent layout shift when stats load */
    min-width: 0;       /* Allow flex shrinking */
    overflow: hidden;   /* Prevent stats from overlapping logo */
}

.hero-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
    /* Fixed min-width to prevent layout shift when numbers change */
    min-width: 75px;
}

.hero-stat .value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #34d399;
    /* Fixed min-width for numbers to prevent shift */
    min-width: 36px;
    text-align: right;
    display: inline-block;
}

.hero-stat .label {
    font-size: 0.7rem;
    color: #8b9bb5;
}

.hero-stat #stat-last-scrape {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 130px;
    text-align: left;
}
.hero-stat #stat-last-scrape.date-recent   { color: #34d399; }
.hero-stat #stat-last-scrape.date-moderate { color: #fbbf24; }
.hero-stat #stat-last-scrape.date-stale    { color: #f87171; }

/* Specific widths for stat values to prevent layout shift */
#stat-dispensaries,
#stat-brands,
#stat-available-strains {
    min-width: 40px;
}

#stat-terpenes,
#stat-cannabinoids {
    min-width: 24px;
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 10px;
    }
    .hero-stats {
        justify-content: center;
    }
}

/* Navigation - Dropdown Menus */
.header-nav {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid #2a3a5c;
    min-height: 32px;  /* Prevent layout shift */
}

.nav-group {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-group-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #c8d6e5;
    font-weight: 600;
    padding: 8px 14px;
    background: #1a2744;
    border: 1px solid #2a3a5c;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-group-label:hover {
    background: #243b63;
    border-color: #3a5080;
}

.nav-group-label::after {
    content: '▼';
    font-size: 0.5rem;
    opacity: 0.7;
    transition: transform 0.2s;
}

.nav-group.open .nav-group-label::after {
    transform: rotate(180deg);
}

.nav-group.open .nav-group-label,
.nav-group-label.has-active {
    background: #243b63;
    border-color: #7fb5d5;
    color: #7fb5d5;
}

/* Dropdown menu */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: #0d1321;
    border: 1px solid #2a3a5c;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    padding: 6px 0;
    margin-top: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.nav-group.open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #c8d6e5;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s;
    border: none;
    background: transparent;
    border-radius: 0;
    min-width: auto;
    justify-content: flex-start;
    white-space: nowrap;
}

.nav-dropdown a:hover {
    background: #1a2744;
    color: #7fb5d5;
    transform: none;
    box-shadow: none;
}

.nav-dropdown a.active {
    background: #1a2744;
    color: #7fb5d5;
}

/* User toggle link in header (not dropdown items) */
.header-nav .user-toggle-link,
.nav-link {
    color: #c8d6e5;
    text-decoration: none;
    padding: 5px 8px;
    background: #1a2744;
    border: 1px solid #2a3a5c;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 500;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    min-width: 70px;
    justify-content: center;
}

.header-nav .user-toggle-link:hover,
.nav-link:hover {
    background: #243b63;
    border-color: #7fb5d5;
    color: #7fb5d5;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    cursor: pointer;
}

.header-nav .user-toggle-link.active,
.nav-link.active {
    background: #243b63;
    border-color: #7fb5d5;
    color: #7fb5d5;
}

/* User Toggle in Header */
.nav-group-user {
    margin-left: auto;
    position: relative;
    z-index: 1002;
}

.user-toggle-link {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 6px 12px !important;
    background: #1a2744 !important;
    border: 1px solid #2a3a5c !important;
    border-radius: 20px !important;
    text-decoration: none;
}

.user-toggle-link:hover {
    background: #243b63 !important;
    border-color: #7fb5d5 !important;
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2a3a5c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #c8d6e5;
}

.user-avatar-small.logged-in {
    background: #7fb5d5;
    color: #0a0e17;
}

.user-name-small {
    color: #c8d6e5;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */
main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

section {
    background: var(--background-elevated);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

section:hover {
    box-shadow: var(--shadow-sm);
}

section h2 {
    color: #4a7fb5;
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 12px;
}

section h3 {
    color: #4a7fb5;
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

section h4 {
    color: #4a7fb5;
    margin-bottom: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: normal;
}

section p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

section p:last-child {
    margin-bottom: 0;
}

section p strong {
    color: var(--text-primary);
}

/* ============================================================================
   FORM ELEMENTS - Refined
   ============================================================================ */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #c8d6e5;
    font-size: 0.78rem;
}

.form-control {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #2a3a5c;
    border-radius: 6px;
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.15s ease;
    background: #1a2744;
    color: #c8d6e5;
}

.form-control:focus {
    outline: none;
    border-color: #7fb5d5;
    box-shadow: 0 0 0 2px rgba(127, 181, 213, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border: 2px solid var(--border-color, #2a3a5c);
    border-radius: 3px;
    background: var(--background-elevated, #111827);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

input[type="checkbox"]:checked {
    background: #4a7fb5;
    border-color: #4a7fb5;
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid #0a0e17;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:hover {
    border-color: #4a7fb5;
    transition: border-color 0.15s;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    font-size: 0.9375rem;
    transition: color var(--transition-fast);
}

.checkbox-label:hover {
    color: #7fb5d5;
}

/* Radio buttons — dark-themed to match page background */
input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color, #2a3a5c);
    border-radius: 50%;
    background: var(--background-elevated, #111827);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin: 0;
}

input[type="radio"]:checked {
    border-color: #4a7fb5;
    background: var(--background-elevated, #111827);
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #4a7fb5;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

input[type="radio"]:hover {
    border-color: #4a7fb5;
    transition: border-color 0.15s;
}

/* ============================================================================
   BUTTONS - Modern & Professional
   ============================================================================ */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.5s ease;
}

.btn:active::after {
    transform: translate(-50%, -50%) scale(2);
}

.btn-primary,
.btn-secondary,
.btn-outline {
    background: var(--background-alt, #0d1321);
    color: var(--text-primary, #c8d6e5);
    border: 1px solid var(--border-color, #2a3a5c);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-outline:hover {
    background: #1a2744;
    border-color: #4a7fb5;
    color: #4a7fb5;
}

.btn-danger {
    background: var(--background-alt, #0d1321);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: #1c1017;
    border-color: #ef4444;
    color: #ef4444;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

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

/* ============================================================================
   CARDS & PANELS - Elevated Design
   ============================================================================ */
.card {
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: #3a5080;
    box-shadow: var(--shadow-sm);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Feature Cards for Home Page */
.feature-card {
    background: #111827;
    border: 1px solid #2a3a5c;
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: block;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    border-color: #3a5080;
    box-shadow: var(--shadow-sm);
}

.feature-card h3 {
    color: #4a7fb5;
    margin-bottom: 8px;
    font-size: 1.05rem;
    font-weight: 700;
}

.feature-card p {
    color: #636e82;
    font-size: 0.88rem;
    line-height: 1.6;
}

/* ============================================================================
   REPORT DESCRIPTION
   ============================================================================ */
.report-description {
    background: #0d1321;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #4a7fb5;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
}

.report-description h3 {
    margin-top: 0;
    color: #c8d6e5;
}

/* ============================================================================
   STATUS MESSAGES - Clean Design
   ============================================================================ */
.status-message {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-message.success {
    background: rgba(74, 127, 181, 0.1);
    color: #4a7fb5;
    border: 1px solid rgba(74, 127, 181, 0.3);
}

.status-message.error {
    background: rgba(248, 113, 113, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.status-message.warning {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ============================================================================
   PROGRESS BAR
   ============================================================================ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #1a2744;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: #7fb5d5;
    border-radius: 4px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================================================
   OUTPUT CONTENT & CODE BLOCKS
   ============================================================================ */
.output-content {
    background: #0d1321;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    color: #c8d6e5;
}

.output-content.error {
    background: rgba(248, 113, 113, 0.1);
    color: var(--error-color);
    border-color: rgba(248, 113, 113, 0.3);
}

/* ============================================================================
   FILE LIST
   ============================================================================ */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 8px;
    background: var(--background-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.file-item:hover {
    background: #1a2744;
    border-color: #3a5080;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.file-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.file-actions {
    display: flex;
    gap: 8px;
}

/* ============================================================================
   FILE VIEWER MODAL
   ============================================================================ */
.file-viewer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: var(--background);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-alt);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.viewer-header h3 {
    margin: 0;
    color: #4a7fb5;
    font-weight: 700;
}

.viewer-content {
    flex: 1;
    overflow: auto;
    padding: 24px 28px;
}

.viewer-content pre {
    margin: 0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ============================================================================
   OVERLAY
   ============================================================================ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

/* ============================================================================
   TABLES - Professional Data Display
   ============================================================================ */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
}

.data-table th {
    background: #0d1321;
    color: #7fb5d5;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 0;
}

/* Spectrum Explorer table uses dynamic header colors */
#strainTable th {
    background: var(--table-header-bg, #78909C);
    color: #000;
    text-transform: none;
    letter-spacing: normal;
}

.data-table th:first-child {
    border-radius: 0;
}

.data-table th:last-child {
    border-radius: 0;
}

.data-table td {
    border-bottom: 1px solid var(--border-color);
    background: var(--background);
}

.data-table tbody tr {
    transition: all var(--transition-fast);
}

.data-table tbody tr:hover td {
    background: #1a2744;
}

.data-table tbody tr:last-child td:first-child {
    border-radius: 0;
}

.data-table tbody tr:last-child td:last-child {
    border-radius: 0;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.data-table th.sortable:hover {
    background: #1a2744;
}

#strainTable th:hover {
    filter: brightness(1.1);
}

/* ============================================================================
   FOOTER
   ============================================================================ */
footer {
    text-align: center;
    padding: 24px;
    color: #636e82;
    margin-top: 32px;
    font-size: 0.78rem;
    border-top: 1px solid #2a3a5c;
    background: #0d1321;
    border-radius: 0;
}

footer p {
    margin: 4px 0;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) {
    body {
        padding-top: 205px; /* Taller header on mobile due to stacked layout and larger logo */
    }

    html.header-scroll-pending body,
    body.header-scroll {
        padding-top: 0 !important;
    }

    header {
        padding: 10px 16px 10px 10px;
        border-radius: 0;
        margin-top: 0;
    }

    html.header-scroll-pending header,
    body.header-scroll header {
        margin-top: -16px;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    section {
        padding: 20px;
        border-radius: var(--radius-md);
    }

    section h2 {
        font-size: 1.25rem;
    }

    .header-nav {
        gap: 4px;
    }

    .header-nav a,
    .nav-link {
        padding: 5px 8px;
        font-size: 0.65rem;
        min-width: 70px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .file-actions {
        width: 100%;
    }

    .file-actions button,
    .file-actions .btn {
        flex: 1;
    }

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

    .data-table {
        font-size: 0.8125rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-teal {
    background: rgba(127, 181, 213, 0.15);
    color: #7fb5d5;
}

.badge-navy {
    background: rgba(42, 58, 92, 0.5);
    color: #82aaff;
}

.badge-orange {
    background: rgba(255, 138, 101, 0.15);
    color: #ff8a65;
}

.badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.badge-error {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 48px;
    color: var(--text-secondary);
}

.loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: #7fb5d5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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

/* No data message */
.no-data {
    text-align: center;
    padding: 48px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Smooth scroll behavior for internal links */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #7fb5d5;
    outline-offset: 2px;
}

/* Selection styling */
::selection {
    background: rgba(127, 181, 213, 0.3);
    color: #c8d6e5;
}

/* ========================================================================
   SCANNED PRODUCT INFO PANEL
   ======================================================================== */
.scanned-info-panel {
    background: linear-gradient(135deg, #0d1321 0%, #111827 100%);
    border: 2px solid #34d399;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.1);
}

.scanned-info-header {
    color: #34d399;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(52, 211, 153, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scanned-info-header::before {
    content: "\2713";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #34d399;
    color: #0a0e17;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.scanned-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.scanned-info-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    background: rgba(26, 39, 68, 0.5);
    border-radius: 6px;
}

.scanned-info-item .info-label {
    font-size: 0.75rem;
    color: #636e82;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.scanned-info-item .info-value {
    font-size: 1rem;
    color: #4a7fb5;
    font-weight: 600;
    margin-top: 0.125rem;
}

.scanned-info-item .info-value.highlight {
    color: #34d399;
    font-size: 1.1rem;
}

/* Special styling for strain name (first item) */
#info-strain {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(52, 211, 153, 0.05) 100%);
    padding: 0.75rem 1rem;
}

#info-strain .info-value {
    font-size: 1.5rem;
    color: #34d399;
}

/* Pesticide and radiation status badges */
#scanned-pesticides.pass,
#scanned-radiation.yes {
    color: #34d399;
}

#scanned-pesticides.fail {
    color: #f87171;
}

/* ==============================================
   Shared Terpene Bullet Styles
   Used across all reports and tables
   ============================================== */

.terpene-bullet {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    margin-bottom: 4px;
    white-space: nowrap;
    font-size: 0.8rem;
}

.terpene-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    flex-shrink: 0;
}

/* Larger variant for prominent displays */
.terpene-bullet.large {
    font-size: 0.9rem;
}

.terpene-bullet.large .terpene-dot {
    width: 10px;
    height: 10px;
}

/* ============================================
   GLOBAL CHECKBOX & RADIO – no accent color
   ============================================ */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-secondary, #8b9bb5);
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    flex-shrink: 0;
}

input[type="checkbox"]:checked {
    background: var(--background-alt, #0d1321);
    border-color: var(--text-secondary, #8b9bb5);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-secondary, #8b9bb5);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    flex-shrink: 0;
}

input[type="radio"]:checked {
    background: var(--background-alt, #0d1321);
    border-color: var(--text-secondary, #8b9bb5);
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
