:root {
    --color-primary: #3b82f6;
    --color-accent: #06b6d4;
    --color-bg-dark: #030712;
    --color-bg-light: #f8fafc;
    --color-card-dark: #111827;
    --color-card-light: #ffffff;
    --color-button-bg: #2563eb;
    --color-button-text: #ffffff;
}

body { 
    -webkit-tap-highlight-color: transparent; 
    font-family: 'Outfit', sans-serif; 
    background-color: var(--color-bg-dark); 
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light Mode Styling - Modern High-Contrast Theme */
body.light-mode {
    background-color: var(--color-bg-light) !important;
    color: #0f172a !important;
}

body.light-mode .glass-panel,
body.light-mode header.glass-panel {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06) !important;
}

/* Header Gym Name Visibility in Light Mode */
body.light-mode header h1,
body.light-mode #app-header-gym-name {
    color: #0284c7 !important;
    -webkit-text-fill-color: #0284c7 !important;
    background-image: none !important;
}

/* Fix dark gradients in light mode */
body.light-mode .bg-gradient-to-r,
body.light-mode .bg-gradient-to-br,
body.light-mode .bg-gradient-to-b {
    background-image: none !important;
}

/* Dynamic CMS Card Backgrounds */
body:not(.light-mode) .bg-gray-800,
body:not(.light-mode) .bg-gray-800\/40,
body:not(.light-mode) .bg-gray-800\/60 {
    background-color: var(--color-card-dark) !important;
}

body.light-mode [class*="bg-gray-800"],
body.light-mode [class*="bg-gray-900"],
body.light-mode [class*="bg-gray-950"],
body.light-mode [class*="bg-slate-900"],
body.light-mode [class*="bg-black"],
body.light-mode .bg-gray-800,
body.light-mode .bg-gray-900,
body.light-mode .bg-gray-950 {
    background-color: var(--color-card-light) !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* Nested cards / sub-boxes */
body.light-mode .bg-gray-950,
body.light-mode .bg-gray-900\/40,
body.light-mode .bg-gray-900\/60,
body.light-mode .bg-gray-900\/80,
body.light-mode .bg-gray-800\/40,
body.light-mode .bg-gray-800\/60,
body.light-mode .bg-gray-800\/80 {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

/* Dynamic CMS Action Buttons Override */
button.bg-blue-600,
button.bg-gradient-to-r.from-blue-500.to-cyan-500,
button.bg-emerald-600 {
    background-color: var(--color-button-bg) !important;
    color: var(--color-button-text) !important;
    background-image: none !important;
}

/* Text Contrast Overrides */
body.light-mode .text-white,
body.light-mode .text-gray-100,
body.light-mode .text-gray-200 {
    color: #0f172a !important;
}

body.light-mode .text-amber-300,
body.light-mode .text-amber-400,
body.light-mode .text-amber-500,
body.light-mode .text-yellow-400 {
    color: #b45309 !important;
}

body.light-mode .text-gray-300,
body.light-mode .text-gray-400,
body.light-mode .text-gray-500,
body.light-mode .text-blue-200\/50,
body.light-mode .text-blue-200 {
    color: #475569 !important;
}

body.light-mode .text-blue-400,
body.light-mode .text-cyan-400,
body.light-mode .text-emerald-400 {
    color: #0284c7 !important;
}

body.light-mode .text-blue-300,
body.light-mode .text-cyan-300 {
    color: #0369a1 !important;
}

/* Form Inputs & Selects */
body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    color: #0f172a !important;
    background-color: #ffffff !important;
    border-color: #94a3b8 !important;
}

body.light-mode select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

body.light-mode input::placeholder,
body.light-mode textarea::placeholder {
    color: #64748b !important;
}

/* Buttons & Actions */
body.light-mode button.bg-gray-900,
body.light-mode button.bg-gray-800,
body.light-mode button.bg-gray-950,
body.light-mode button.bg-gray-800\/60 {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

body.light-mode button.bg-gray-900:hover,
body.light-mode button.bg-gray-800:hover {
    background-color: #cbd5e1 !important;
}

/* Floating Nav Bar */
body.light-mode nav.glass-panel,
body.light-mode nav.fixed,
body.light-mode .fixed.bottom-4 {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
}

body.light-mode nav button,
body.light-mode nav span {
    color: #475569 !important;
}

body.light-mode nav button.text-blue-400,
body.light-mode nav button.text-blue-500 {
    color: #0284c7 !important;
}

/* Numeric Keypad */
body.light-mode #numeric-keypad-sheet {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15) !important;
}

body.light-mode #numeric-keypad-display {
    color: #0f172a !important;
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

body.light-mode #numeric-keypad-sheet button {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
