/* ==================== СВЕТЛАЯ ТЕМА ==================== */
:root,
[data-theme="light"] {
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    --bg: #f5f5f5;
    --sidebar-bg: #fafafa;
    --card-bg: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #666;
    --border: #e0e0e0;
    --accent: #2564cf;
    --accent-hover: #1d4fb0;
    --red: #d13438;
    --red-hover: #b52d31;
    --star: #f4b400;
    --checkbox-border: #8a8a8a;
    --done-text: #999;
    --link-color: #2564cf;
    --link-hover: #1d4fb0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --hover-bg: #e8e8e8;
    --active-bg: #dce8f9;
    --input-bg: #fafafa;
    --edit-bg: #f0f6ff;
    --nav-count-bg: #ddd;
    --radius: 8px;
    --transition: 0.2s ease;
    --theme-btn-bg: #f0f0f0;
    --glass-effect: none;
    --glass-border: var(--border);
}

/* ==================== ТЁМНАЯ ТЕМА ==================== */
[data-theme="dark"] {
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    --bg: #1e1e1e;
    --sidebar-bg: #252525;
    --card-bg: #2d2d2d;
    --text: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border: #404040;
    --accent: #4da3ff;
    --accent-hover: #6bb5ff;
    --red: #ff6b6b;
    --red-hover: #ff5252;
    --star: #ffd700;
    --checkbox-border: #666;
    --done-text: #666;
    --link-color: #4da3ff;
    --link-hover: #6bb5ff;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.5);
    --hover-bg: #3a3a3a;
    --active-bg: #1a3a5c;
    --input-bg: #363636;
    --edit-bg: #1a3a5c;
    --nav-count-bg: #404040;
    --radius: 8px;
    --transition: 0.2s ease;
    --theme-btn-bg: #363636;
    --glass-effect: none;
    --glass-border: var(--border);
}

/* ==================== КОНТРАСТНАЯ ТЕМА ==================== */
[data-theme="contrast"] {
    --font-family: Arial, Helvetica, sans-serif;
    --bg: #000000;
    --sidebar-bg: #0a0a0a;
    --card-bg: #111111;
    --text: #ffffff;
    --text-secondary: #cccccc;
    --border: #ffffff;
    --accent: #ffff00;
    --accent-hover: #ffdd00;
    --red: #ff4444;
    --red-hover: #ff2222;
    --star: #ffff00;
    --checkbox-border: #ffffff;
    --done-text: #888888;
    --link-color: #ffff00;
    --link-hover: #ffdd00;
    --shadow: 0 0 0 2px #ffffff;
    --shadow-hover: 0 0 0 3px #ffff00;
    --hover-bg: #222222;
    --active-bg: #333300;
    --input-bg: #1a1a1a;
    --edit-bg: #333300;
    --nav-count-bg: #333333;
    --radius: 0px;
    --transition: 0.1s ease;
    --theme-btn-bg: #1a1a1a;
    --glass-effect: none;
    --glass-border: var(--border);
}

/* ==================== РЕТРО-ТЕМА ==================== */
[data-theme="retro"] {
    --font-family: 'Courier New', Courier, monospace;
    --bg: #f5e6c8;
    --sidebar-bg: #e8d5a8;
    --card-bg: #faf0d7;
    --text: #2c1810;
    --text-secondary: #6b4e3d;
    --border: #c4a67a;
    --accent: #8b4513;
    --accent-hover: #6b3410;
    --red: #cc3333;
    --red-hover: #aa2222;
    --star: #cc8800;
    --checkbox-border: #8b7355;
    --done-text: #8b7355;
    --link-color: #8b4513;
    --link-hover: #6b3410;
    --shadow: 3px 3px 0 #8b7355;
    --shadow-hover: 5px 5px 0 #6b4e3d;
    --hover-bg: #d4c4a8;
    --active-bg: #d4c4a8;
    --input-bg: #faf0d7;
    --edit-bg: #e8d5a8;
    --nav-count-bg: #d4c4a8;
    --radius: 0px;
    --transition: 0.15s ease;
    --theme-btn-bg: #d4c4a8;
    --glass-effect: none;
    --glass-border: var(--border);
}

/* ==================== ТЕМА AERO (WINDOWS 7) ==================== */
[data-theme="aero"] {
    --font-family: 'Segoe UI', 'Segoe UI Light', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    
    --bg: #dce8f4;
    --sidebar-bg: rgba(220, 232, 244, 0.7);
    --card-bg: rgba(255, 255, 255, 0.75);
    --text: #1a2a3a;
    --text-secondary: #5a6a7a;
    --border: rgba(180, 200, 220, 0.6);
    
    --accent: #3a7bd5;
    --accent-hover: #2e6bc4;
    --red: #d13438;
    --red-hover: #b52d31;
    --star: #e8a800;
    --checkbox-border: #8a9aaa;
    --done-text: #8a9aaa;
    
    --link-color: #3a7bd5;
    --link-hover: #2e6bc4;
    
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    --hover-bg: rgba(200, 215, 230, 0.5);
    --active-bg: rgba(180, 200, 220, 0.6);
    --input-bg: rgba(255, 255, 255, 0.8);
    --edit-bg: rgba(220, 235, 250, 0.9);
    --nav-count-bg: rgba(180, 200, 220, 0.5);
    
    --radius: 6px;
    --transition: 0.25s ease;
    --theme-btn-bg: rgba(255, 255, 255, 0.6);
    
    --glass-effect: blur(8px) saturate(120%);
    --glass-border: rgba(255, 255, 255, 0.5);
}

/* ==================== LIQUID GLASS (APPLE STYLE) ==================== */
[data-theme="glass-dark"] {
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    
    --bg: #0a0a0f;
    --sidebar-bg: rgba(255, 255, 255, 0.03);
    --card-bg: rgba(255, 255, 255, 0.05);
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --border: rgba(255, 255, 255, 0.1);
    
    --accent: #0A84FF; 
    --accent-hover: #409CFF;
    --red: #FF453A;
    --red-hover: #FF6961;
    --star: #FFD60A;
    --checkbox-border: rgba(255, 255, 255, 0.3);
    --done-text: rgba(255, 255, 255, 0.4);
    
    --link-color: #64D2FF;
    --link-hover: #8CE0FF;
    
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --hover-bg: rgba(255, 255, 255, 0.08);
    --active-bg: rgba(255, 255, 255, 0.12);
    --input-bg: rgba(0, 0, 0, 0.2);
    --edit-bg: rgba(255, 255, 255, 0.08);
    --nav-count-bg: rgba(255, 255, 255, 0.1);
    
    --radius: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --theme-btn-bg: rgba(255, 255, 255, 0.05);
    
    --glass-effect: blur(40px) saturate(200%);
    --glass-border: rgba(255, 255, 255, 0.15);
}

/* 
 * Многослойный цветной Mesh Gradient с анимацией.
 */
body[data-theme="glass-dark"] {
    background-color: #0a0a0f !important;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(90, 60, 180, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(180, 50, 120, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 50% 95%, rgba(30, 150, 180, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 70% 15%, rgba(40, 120, 220, 0.4) 0%, transparent 50%) !important;
    background-size: 200% 200% !important;
    background-attachment: fixed !important;
    animation: mesh-bg-move 20s infinite alternate ease-in-out !important;
}

@keyframes mesh-bg-move {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 100%; }
}