:root {
    /* Base Colors & Global Variables */
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    
    /* Light Mode Constants */
    --bg-main: #f0f9ff; /* Very soft light blue */
    --bg-body-secondary: rgba(14, 165, 233, 0.05);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-hover: rgba(14, 165, 233, 0.08);
    --border-color: rgba(14, 165, 233, 0.2);
    --border-hover: rgba(14, 165, 233, 0.4);
    
    --text-primary: #0f172a;
    --text-dim: #475569;
    --text-accent: #0284c7; /* Darker blue for light mode readability */
    
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(14, 165, 233, 0.2);
    
    --glow-opacity: 0.1;
    --modal-overlay: rgba(15, 23, 42, 0.4);
}

:root.dark {
    /* Dark Mode Constants */
    --bg-main: #020617;
    --bg-body-secondary: rgba(14, 165, 233, 0.03);
    --card-bg: rgba(15, 23, 42, 0.4);
    --card-hover: rgba(14, 165, 233, 0.1);
    --border-color: rgba(56, 189, 248, 0.25);
    --border-hover: rgba(14, 165, 233, 0.5);
    
    --text-primary: #f8fafc;
    --text-dim: #94a3b8;
    --text-accent: #0ea5e9;
    
    --input-bg: rgba(2, 6, 23, 0.6);
    --input-border: rgba(30, 41, 59, 1);
    
    --glow-opacity: 0.4;
    --modal-overlay: rgba(2, 6, 23, 0.8);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    background-image: 
        radial-gradient(circle at 20% 30%, var(--bg-body-secondary) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, var(--bg-body-secondary) 0%, transparent 40%),
        linear-gradient(var(--bg-body-secondary) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-body-secondary) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.glass-card {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: var(--border-hover);
    background: var(--card-hover);
}

.glow-text {
    text-shadow: 0 0 15px rgba(14, 165, 233, var(--glow-opacity));
}

.corner-bracket {
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: var(--accent);
    opacity: 0.5;
}

.top-left { top: 12px; left: 12px; border-top: 2px solid; border-left: 2px solid; }
.top-right { top: 12px; right: 12px; border-top: 2px solid; border-right: 2px solid; }
.bottom-left { bottom: 12px; left: 12px; border-bottom: 2px solid; border-left: 2px solid; }
.bottom-right { bottom: 12px; right: 12px; border-bottom: 2px solid; border-right: 2px solid; }

.scanlines { position: relative; overflow: hidden; }
.scanlines::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.05) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.01), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.01));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    opacity: 0.3;
}

.timer-glow {
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.6));
}

/* Custom Modal Animations */
#custom-modal {
    background: var(--modal-overlay) !important;
}

#custom-modal.opacity-0 {
    pointer-events: none;
}

#custom-modal .glass-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* Custom Inputs Styling */
#todo-input, 
#custom-modal input {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

#todo-input::placeholder,
#custom-modal input::placeholder {
    color: var(--text-dim) !important;
    opacity: 0.6;
}

/* Global Utility Overrides for Theme Consistency */
.text-sky-400 { color: var(--text-accent) !important; }
.text-sky-500 { color: var(--accent) !important; }
.text-white { color: var(--text-primary) !important; }
.text-slate-200 { color: var(--text-primary) !important; }
.text-slate-300 { color: var(--text-primary) !important; }
.text-slate-400 { color: var(--text-dim) !important; }
.text-slate-500 { color: var(--text-dim) !important; }

/* Dark Mode Specific Overrides */
:root.dark .text-white { color: #f8fafc !important; }
:root.dark .text-sky-400 { color: #38bdf8 !important; }

/* Scrollbar Styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
