:root {
    /* ================================================
       SpeedPaper Design System - Premium Light Mode
       Professional: Navy + Coral + Mint
       ================================================ */
    
    /* Force light color scheme */
    color-scheme: light only;
    
    /* Brand Colors - Professional Palette */
    --primary-color: #0f172a;       /* Navy Dark */
    --primary-light: #1e3a5f;       /* Navy Medium */
    --secondary-color: #1e40af;     /* Royal Blue */
    --secondary-light: #3b82f6;     /* Blue */
    
    /* Accent Colors - Coral & Mint */
    --accent-coral: #f97316;        /* Coral/Orange */
    --accent-coral-light: #fb923c;
    --accent-coral-bg: #fff7ed;
    --accent-mint: #10b981;         /* Mint/Emerald */
    --accent-mint-light: #34d399;
    --accent-mint-bg: #ecfdf5;
    --accent-rose: #f43f5e;         /* Rose accent */
    --accent-rose-light: #fb7185;
    --accent-rose-bg: #fff1f2;
    
    /* Status Colors */
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0284c7;

    /* Background Colors - Clean Light Mode */
    --bg-color: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --card-bg: #ffffff;
    
    /* Text Colors - High Contrast */
    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* Border Colors */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;

    /* Typography */
    --font-main: 'Inter', 'Work Sans', system-ui, -apple-system, sans-serif;
    --font-heading: 'Work Sans', 'Outfit', sans-serif;

    /* Font Sizes - Fluid Typography */
    --text-xs: clamp(0.69rem, 0.66rem + 0.18vw, 0.80rem);
    --text-sm: clamp(0.83rem, 0.78rem + 0.29vw, 1.00rem);
    --text-base: clamp(1.00rem, 0.91rem + 0.43vw, 1.25rem);
    --text-lg: clamp(1.20rem, 1.07rem + 0.63vw, 1.56rem);

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    /* Layout */
    --container-width: 1280px;
    --header-height: 72px;
    --mobile-nav-height: 64px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows - Softer, Professional */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.03);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.08);
    --shadow-primary: 0 4px 14px 0 rgb(30 64 175 / 0.20);
    --shadow-coral: 0 4px 14px 0 rgb(249 115 22 / 0.20);

    /* Transitions */
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

/* ================================================
   DISABLE SYSTEM DARK MODE COMPLETELY
   ================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light only;
        /* Keep all light mode values */
        --bg-color: #f8fafc;
        --bg-secondary: #f1f5f9;
        --card-bg: #ffffff;
        --text-main: #0f172a;
        --text-secondary: #334155;
        --text-muted: #64748b;
        --text-light: #94a3b8;
        --border-color: #e2e8f0;
        --border-light: #f1f5f9;
    }
    
    html, body {
        background-color: var(--bg-color) !important;
        color: var(--text-main) !important;
    }
    
    /* Force light backgrounds */
    .bg-white,
    [class*="bg-white"] {
        background-color: #ffffff !important;
    }
    
    /* Force proper text colors */
    .text-gray-800 { color: #1f2937 !important; }
    .text-gray-700 { color: #374151 !important; }
    .text-gray-600 { color: #4b5563 !important; }
    .text-gray-500 { color: #6b7280 !important; }
    .text-gray-900 { color: #111827 !important; }
    
    /* Force light inputs */
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        background-color: #ffffff !important;
        color: #1f2937 !important;
        border-color: #d1d5db !important;
    }
    
    input::placeholder,
    textarea::placeholder {
        color: #9ca3af !important;
    }
    
    /* Cards and panels stay light */
    .card,
    .sp-card,
    .sp-card-padded,
    .sp-card-lg {
        background-color: #ffffff !important;
        color: #1f2937 !important;
    }
}

/* Remove dark-mode class support - only manual toggle */
/* .dark-mode class removed to prevent accidental dark mode */

/* ================================================
   Base Reset & Defaults
   ================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color var(--duration-normal) var(--ease-out),
                color var(--duration-normal) var(--ease-out);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover { color: var(--secondary-color); }

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

::selection {
    background-color: var(--secondary-color);
    color: white;
}

:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

:focus:not(:focus-visible) { outline: none; }

/* ================================================
   Container & Layout
   ================================================ */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 768px) {
    .container { padding: 0 var(--space-6); }
}

/* ================================================
   Buttons - Premium Design
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-main);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width var(--duration-slow), height var(--duration-slow);
}

.btn:active::before { width: 300%; height: 300%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), #1d4ed8);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgb(37 99 235 / 0.35);
}

.btn-primary:active { transform: translateY(0); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-hover), #b45309);
    transform: translateY(-2px);
}

/* ================================================
   Cards
   ================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ================================================
   Form Elements
   ================================================ */
input, select, textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
}

input:hover, select:hover, textarea:hover { border-color: var(--text-muted); }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}

input::placeholder, textarea::placeholder { color: var(--text-light); }

input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ================================================
   Header - CRITICAL STYLES - High Contrast
   ================================================ */
header {
    background: #ffffff !important;
    height: auto;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    transition: box-shadow var(--duration-normal);
}

/* Ensure all header text is dark for contrast */
header,
header * {
    color: #1f2937;
}

header a {
    color: #1f2937;
}

header a:hover {
    color: #2563eb;
}

/* Top bar should be colored */
.top-bar-critical,
header > div:first-of-type.top-bar-critical {
    background: linear-gradient(90deg, #2563eb, #1d4ed8) !important;
}

.top-bar-critical,
.top-bar-critical * {
    color: #ffffff !important;
}

/* Header icons */
header .fas,
header .far,
header .fab {
    color: inherit;
}

header button .fas.fa-magic {
    color: #9333ea;
}

/* Search input specific */
header input[type="text"],
header input#searchInput {
    background: #f9fafb;
    color: #1f2937;
    border: 1px solid #d1d5db;
}

header input[type="text"]::placeholder {
    color: #6b7280;
}

header input[type="text"]:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Cart button styling */
header #headerCartBtn {
    background: #fef3c7;
    border: 1px solid #fcd34d;
}

header #headerCartBtn:hover {
    background: #fde68a;
}

header #headerCartBtn i,
header #headerCartBtn span {
    color: #1f2937 !important;
}

/* Navigation bar */
header nav {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

header nav a {
    color: #374151;
    font-weight: 600;
}

header nav a:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

/* Upload list button in nav */
header nav a[href="/lists"] {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #1e40af !important;
}

header nav a[href="/lists"]:hover {
    background: #fde68a;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* ================================================
   Product Cards
   ================================================ */
.product-card {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-out);
}

.product-card:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
}

/* ================================================
   Badges
   ================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.badge-success { background: rgb(5 150 105 / 0.1); color: var(--success-color); }
.badge-danger { background: rgb(220 38 38 / 0.1); color: var(--danger-color); }

/* ================================================
   Loading
   ================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================
   Utilities
   ================================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* Touch-friendly (min 44px) */
@media (pointer: coarse) {
    .btn, button, a { min-height: 44px; }
    input, select, textarea { min-height: 48px; }
}

/* ================================================
   Mobile Enhancements
   ================================================ */
@media (max-width: 768px) {
    /* Larger touch targets */
    .product-card button,
    .product-card a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better tap highlighting */
    a, button {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
    }
    
    /* Smooth scrolling for horizontal lists */
    .hide-scroll {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .hide-scroll > * {
        scroll-snap-align: start;
    }
    
    /* Pull to refresh area */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: env(safe-area-inset-top, 0);
        background: linear-gradient(90deg, #2563eb, #1d4ed8);
        z-index: 999;
    }
}

/* ================================================
   Smooth Page Transitions
   ================================================ */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ================================================
   Interactive States
   ================================================ */
.interactive-scale {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.interactive-scale:hover {
    transform: scale(1.02);
}

.interactive-scale:active {
    transform: scale(0.98);
}

/* ================================================
   Toast Notifications
   ================================================ */
.toast-notification {
    max-width: 90vw;
    min-width: 280px;
}

@media (min-width: 640px) {
    .toast-notification {
        max-width: 400px;
    }
}

/* ================================================
   Progress Indicators
   ================================================ */
.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), #60a5fa);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* ================================================
   Floating Labels
   ================================================ */
.floating-label-group {
    position: relative;
}

.floating-label-group input:focus + label,
.floating-label-group input:not(:placeholder-shown) + label {
    transform: translateY(-100%) scale(0.85);
    color: var(--secondary-color);
}

.floating-label-group label {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.2s ease;
    pointer-events: none;
    color: var(--text-muted);
}

/* ================================================
   Better Focus States for Accessibility
   ================================================ */
:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* ================================================
   Scroll Progress Bar
   ================================================ */
#scrollProgress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ================================================
   Header Scroll State
   ================================================ */
.header-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header-scrolled .container {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
}

/* ================================================
   Gradient Text
   ================================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--secondary-color), #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ================================================
   Glass Effect
   ================================================ */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ================================================
   Print Styles
   ================================================ */
@media print {
    header, footer, nav, .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}