/* --- 1. BASIC THEME (Default) --- */
:root, [data-theme="basic"] {
    --bg-mesh: radial-gradient(at 0% 0%, #fff0f0 0px, transparent 50%), radial-gradient(at 100% 100%, #f0f4ff 0px, transparent 50%), #fdfaf9;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #2d3748;
    --text-muted: #718096;
    --primary: #e5989b;
    --primary-hover: #d4878a;
    --primary-glow: rgba(229, 152, 155, 0.4);
    
    --flow-light: rgba(229, 152, 155, 0.2);
    --flow-med: rgba(229, 152, 155, 0.6);
    --flow-heavy: rgba(229, 152, 155, 1);
    
    --fertile-bg: rgba(181, 201, 154, 0.15);
    --fertile-border: #b5c99a;
    --fertile-text: #6b824a;
    --bg-element: #f7fafc;
    --border-color: #e2e8f0;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    
    --selected-bg: var(--text-main);
    --selected-text: var(--bg-element);
    
    /* Smooth Animated Floating Hearts (Soft Pink) */
    --fertile-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cstyle%3E@keyframes f%7B0%25%7Btransform:translateY(15px) scale(0);opacity:0%7D20%25%7Bopacity:.8%7D80%25%7Bopacity:.8%7D100%25%7Btransform:translateY(-25px) scale(1.5);opacity:0%7D%7D.h%7Banimation:f 4s infinite cubic-bezier(.4,0,.2,1);fill:%23e5989b%7D.h1%7Banimation-duration:3.5s;animation-delay:0s%7D.h2%7Banimation-duration:4.8s;animation-delay:1.2s%7D.h3%7Banimation-duration:4.2s;animation-delay:2.5s%7D.h4%7Banimation-duration:5.5s;animation-delay:0.8s%7D.h5%7Banimation-duration:3.8s;animation-delay:3.2s%7D%3C/style%3E%3Cg class='h h1' transform='translate(10,50) scale(0.6)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h2' transform='translate(65,65) scale(0.8)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h3' transform='translate(35,25) scale(0.5)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h4' transform='translate(70,15) scale(0.7)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h5' transform='translate(45,75) scale(0.4)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3C/svg%3E");
}

[data-theme="basic"][data-mode="dark"] {
    --bg-mesh: radial-gradient(at 0% 0%, #2c1e2e 0px, transparent 50%), radial-gradient(at 100% 100%, #1e202e 0px, transparent 50%), #121418;
    --glass-bg: rgba(30, 32, 40, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f7fafc;
    --text-muted: #a0aec0;
    --bg-element: #282a36;
    --border-color: #3f4455;
    --selected-bg: var(--text-main);
    --selected-text: #000000;
}

/* --- 2. PERIOD THEME (Discord Deep Red Custom) --- */
[data-theme="blood"] {
    --bg-mesh: radial-gradient(at 0% 0%, #ffe6eb 0px, transparent 50%), radial-gradient(at 100% 100%, #ffd6e0 0px, transparent 50%), #fff0f3;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --text-main: #33000b;
    --text-muted: #8a4a5b;
    --primary: #FF005E; 
    --primary-hover: #cc004b;
    --primary-glow: rgba(255, 0, 94, 0.2);
    
    --flow-light: rgba(255, 0, 94, 0.2);
    --flow-med: rgba(255, 0, 94, 0.6);
    --flow-heavy: rgba(255, 0, 94, 0.95);
    
    --bg-element: #ffffff;
    --border-color: #f7c3ce;
    
    --fertile-bg: rgba(255, 0, 94, 0.05);
    --fertile-border: #ff80ab;
    --fertile-text: #FF005E;
    
    --selected-bg: #e2e8f0; 
    --selected-text: #0f172a;
    
    /* Smooth Animated Floating Hearts (Deep Red) */
    --fertile-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cstyle%3E@keyframes f%7B0%25%7Btransform:translateY(15px) scale(0);opacity:0%7D20%25%7Bopacity:.8%7D80%25%7Bopacity:.8%7D100%25%7Btransform:translateY(-25px) scale(1.5);opacity:0%7D%7D.h%7Banimation:f 4s infinite cubic-bezier(.4,0,.2,1);fill:%23FF005E%7D.h1%7Banimation-duration:3.5s;animation-delay:0s%7D.h2%7Banimation-duration:4.8s;animation-delay:1.2s%7D.h3%7Banimation-duration:4.2s;animation-delay:2.5s%7D.h4%7Banimation-duration:5.5s;animation-delay:0.8s%7D.h5%7Banimation-duration:3.8s;animation-delay:3.2s%7D%3C/style%3E%3Cg class='h h1' transform='translate(10,50) scale(0.6)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h2' transform='translate(65,65) scale(0.8)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h3' transform='translate(35,25) scale(0.5)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h4' transform='translate(70,15) scale(0.7)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h5' transform='translate(45,75) scale(0.4)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3C/svg%3E");
}

[data-theme="blood"][data-mode="dark"] {
    --bg-mesh: radial-gradient(at 0% 0%, #4a000d 0px, transparent 60%), radial-gradient(at 100% 100%, #29000b 0px, transparent 50%), #000000;
    --glass-bg: rgba(20, 0, 5, 0.7);
    --glass-border: rgba(255, 0, 94, 0.2);
    --text-main: #ffffff;
    --text-muted: #b3858c;
    --primary: #FF0004; 
    --primary-hover: #FF005E; 
    --primary-glow: rgba(255, 0, 4, 0.4);
    
    /* Corrected to form a perfect gradient: Dusty Rose -> Muted Ruby -> Burgundy */
    --flow-light: #b87a8b; 
    --flow-med: #9e2a46; 
    --flow-heavy: #7a001a; 
    
    --bg-element: rgba(255, 255, 255, 0.05);
    --border-color: #5c0012;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    
    --selected-bg: #cbd5e0;
    --selected-text: #000000;
}

/* --- 3. OVULATION THEME (Luminous Violet Confetti) --- */
[data-theme="love"] {
    --bg-mesh: radial-gradient(at 0% 0%, #f3e8ff 0px, transparent 50%), radial-gradient(at 100% 100%, #fef08a 0px, transparent 50%), radial-gradient(at 0% 100%, #e0f2fe 0px, transparent 50%), #faf5ff;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --primary: #8b5cf6; 
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.3);
    
    --flow-light: rgba(139, 92, 246, 0.2);
    --flow-med: rgba(139, 92, 246, 0.6);
    --flow-heavy: rgba(139, 92, 246, 0.95);
    
    --fertile-bg: rgba(255, 51, 133, 0.05);
    --fertile-border: #ff3385; 
    --fertile-text: #d53f8c;
    
    --text-main: #2e1065;
    --text-muted: #6b21a8;
    --bg-element: #ffffff;
    --border-color: #e9d5ff;
    
    --selected-bg: #cda5d6;
    --selected-text: #ffffff;

    /* Smooth Animated Floating Hearts (Classy Pink) */
    --fertile-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cstyle%3E@keyframes f%7B0%25%7Btransform:translateY(15px) scale(0);opacity:0%7D20%25%7Bopacity:.8%7D80%25%7Bopacity:.8%7D100%25%7Btransform:translateY(-25px) scale(1.5);opacity:0%7D%7D.h%7Banimation:f 4s infinite cubic-bezier(.4,0,.2,1);fill:%23ED1C68%7D.h1%7Banimation-duration:3.5s;animation-delay:0s%7D.h2%7Banimation-duration:4.8s;animation-delay:1.2s%7D.h3%7Banimation-duration:4.2s;animation-delay:2.5s%7D.h4%7Banimation-duration:5.5s;animation-delay:0.8s%7D.h5%7Banimation-duration:3.8s;animation-delay:3.2s%7D%3C/style%3E%3Cg class='h h1' transform='translate(10,50) scale(0.6)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h2' transform='translate(65,65) scale(0.8)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h3' transform='translate(35,25) scale(0.5)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h4' transform='translate(70,15) scale(0.7)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3Cg class='h h5' transform='translate(45,75) scale(0.4)'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3C/svg%3E");
}

[data-theme="love"][data-mode="dark"] {
    --bg-mesh: radial-gradient(at 0% 0%, #3b0764 0px, transparent 50%), radial-gradient(at 100% 100%, #422006 0px, transparent 50%), #1e1b4b;
    --glass-bg: rgba(20, 15, 40, 0.7);
    --text-main: #f3e8ff;
    --text-muted: #c084fc;
    --primary: #a855f7;
    --primary-hover: #c084fc;
    --primary-glow: rgba(168, 85, 247, 0.4);
    
    --flow-light: rgba(168, 85, 247, 0.25);
    --flow-med: rgba(168, 85, 247, 0.6);
    --flow-heavy: rgba(168, 85, 247, 1);
    
    --fertile-bg: rgba(255, 51, 133, 0.1);
    --fertile-border: #ff3385;
    --fertile-text: #ff80ab;
    
    --bg-element: rgba(255, 255, 255, 0.05);
    --border-color: #581c87;
    --selected-bg: #d8b4fe;
    --selected-text: #2e1065;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-mesh);
    color: var(--text-main);
    margin: 0;
    transition: background 0.4s ease, color 0.4s ease;
    min-height: 100vh;
}

/* Theme Controls UI */
.theme-controls { background: var(--bg-element); border: 1px solid var(--border-color); border-radius: 16px; padding: 12px; margin: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.theme-controls small { font-size: 0.7rem; text-transform: uppercase; font-weight: 700; color: var(--text-muted); letter-spacing: 0.5px; }
.theme-select { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--glass-bg); color: var(--text-main); font-family: inherit; font-weight: 600; font-size: 0.85rem; outline: none; cursor: pointer; transition: 0.2s; }
.theme-select:focus { border-color: var(--primary); }
.mode-toggle-btn { padding: 10px; margin: 0; background: transparent; justify-content: flex-start; }

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 var(--primary-glow); } 70% { box-shadow: 0 0 0 8px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes radar { 0% { transform: scale(0.5); opacity: 0.8; } 100% { transform: scale(2.5); opacity: 0; } }

/* App Layout */
.app-shell { display: flex; min-height: 100vh; }

/* Sidebar & Stats */
.sidebar { width: 260px; padding: 32px 24px; display: flex; flex-direction: column; z-index: 10; box-shadow: var(--shadow-sm); }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 40px; letter-spacing: -0.5px; }
.logo span { color: var(--text-main); font-weight: 400; }

.cycle-ring-container { 
    position: relative;
    display: flex; 
    justify-content: center; 
    align-items: center;
    width: 260px; /* Expands to fill sidebar width */
    height: 260px;
    margin: -10px -24px 20px -24px; /* Pulls it slightly out of standard padding */
    overflow: visible;
}

#auraCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 260px;
    height: 260px;
    z-index: 1;
    pointer-events: none; /* Lets clicks pass through if needed */
}

.cycle-ring-inner { 
    position: relative;
    z-index: 2; /* Floats above the particle storm */
    width: 120px; 
    height: 120px; 
    border-radius: 50%; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    /* Upgraded Glassmorphism for the center orb */
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px -10px var(--primary-glow), inset 0 0 15px rgba(255,255,255,0.5);
    animation: floatOrb 6s ease-in-out infinite;
}

@keyframes floatOrb {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}
.ring-day { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.ring-phase { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-top: 4px; padding: 0 10px; line-height: 1.2; }

.stats-box { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.stat-pill { display: flex; align-items: center; padding: 12px 16px; background: var(--bg-element); border-radius: 16px; border: 1px solid var(--border-color); }
.stat-icon { font-size: 1.2rem; margin-right: 12px; background: var(--glass-bg); padding: 8px; border-radius: 10px; }
.stat-info { display: flex; flex-direction: column; width: 100%; }
.stat-info small { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-info strong { font-size: 1.1rem; color: var(--text-main); margin-top: 2px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: none; background: transparent; color: var(--text-muted); font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.2s; font-family: inherit; }
.nav-item:hover { background: var(--bg-element); color: var(--text-main); }
.nav-item.active { background: var(--primary-glow); color: var(--primary); }
.text-danger { color: #f56565 !important; }
.text-danger:hover { background: rgba(245, 101, 101, 0.1); }

/* Main Content */
.content { flex: 1; padding: 40px 50px; display: flex; flex-direction: column; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; animation: fadeIn 0.4s ease-out; }
.greeting { margin: 0; font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; }
.date-today { margin: 4px 0 0 0; color: var(--text-muted); font-weight: 500; }

.sync-status { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); background: var(--glass-bg); padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border-color); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e0; }
.sync-status.synced { color: var(--fertile-text); border-color: var(--fertile-border); }
.sync-status.synced .status-dot { background: var(--fertile-text); animation: pulse-ring 2s infinite; }
/* --- TOP BADGES & USER COUNTER --- */
.top-badges { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    flex-wrap: wrap; /* Ensures it doesn't break on very small mobile screens */
}

.user-counter {
    display: flex; 
    align-items: center; 
    gap: 6px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: var(--text-muted); 
    background: var(--glass-bg); 
    padding: 8px 16px; 
    border-radius: 20px; 
    border: 1px solid var(--border-color); 
    transition: all 0.2s ease;
}

.user-counter svg {
    stroke: var(--text-muted);
    transition: 0.2s ease;
}

/* Subtle glow and color shift on hover */
.user-counter:hover {
    color: var(--text-main);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.user-counter:hover svg {
    stroke: var(--primary);
}
.dashboard-grid { display: grid; grid-template-columns: 1fr 340px; gap: 30px; animation: fadeIn 0.5s ease-out; }
.card { border-radius: 24px; padding: 28px; box-shadow: var(--shadow-lg); transition: transform 0.3s ease; }

/* Reimagined Calendar */
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.cal-header h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.cal-nav-btns { display: flex; gap: 8px; }
.icon-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-element); color: var(--text-main); cursor: pointer; transition: 0.2s; }
.icon-btn:hover { background: var(--border-color); }

.weekday-header { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: var(--text-muted); font-weight: 700; font-size: 0.7rem; letter-spacing: 1px; margin-bottom: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; animation: fadeIn 0.3s ease-out; }
.day-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 16px; font-size: 0.95rem; font-weight: 600; cursor: pointer; position: relative; border: 2px solid transparent; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); color: var(--text-main); }
.day-cell:hover { transform: scale(1.08) translateY(-2px); box-shadow: var(--shadow-sm); z-index: 2; background: var(--bg-element); border-color: var(--border-color); }
.day-cell.selected { 
    border-color: var(--selected-bg) !important; 
    background: var(--selected-bg); 
    color: var(--selected-text) !important; 
    transform: scale(1.05); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2;
}
/* Squircle Current Day Indicator */
.day-cell.today::before { content: ''; position: absolute; inset: -5px; border-radius: 20px; border: 2px solid var(--primary); animation: pulse-ring 2.5s infinite; pointer-events: none; }

/* Reimagined Flow States (Depth instead of distinct solid colors) */
.is-actual { color: var(--primary) !important; }
.is-actual.f-light { background: var(--flow-light); border-color: transparent; }
.is-actual.f-medium { background: var(--flow-med); color: #fff !important; }
.is-actual.f-heavy { background: var(--flow-heavy); color: #fff !important; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); }
.is-predicted { border: 2px dashed var(--primary); color: var(--primary); background: transparent; }

/* Botanical Fertile Window */
/* Animated Botanical / Heart Fertile Window */
.is-fertile { 
    background-color: var(--fertile-bg); 
    border: 2px dashed var(--fertile-border); 
    color: var(--fertile-text); 
    background-image: var(--fertile-pattern);
    background-size: cover; /* Stretches the SVG container exactly to the 100x100 bounds */
    background-position: center;
    background-repeat: no-repeat;
}

/* Remove the old static text icon if it exists */
.is-fertile::after { 
    display: none; 
}
.legend { display: flex; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-color); font-size: 0.8rem; font-weight: 600; color: var(--text-muted); justify-content: center; }
.l-item { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 4px; }
.dot.actual { background: var(--flow-med); }
.dot.predicted { border: 2px dashed var(--primary); }
.dot.fertile { background: var(--fertile-bg); border: 1px dotted var(--fertile-border); }

/* Action Panel */
.action-panel { display: flex; flex-direction: column; gap: 24px; }
.log-card h3 { margin: 0 0 16px 0; font-size: 1.1rem; }
.highlight-date { color: var(--primary); }

/* Empty State */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 0; text-align: center; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.empty-state svg { margin-bottom: 12px; opacity: 0.5; }

/* Segmented Control Logging */
.flow-selector { display: flex; background: var(--bg-element); border-radius: 16px; padding: 6px; gap: 6px; border: 1px solid var(--border-color); }
.flow-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 4px; border: none; background: transparent; border-radius: 12px; color: var(--text-muted); font-weight: 600; font-size: 0.8rem; cursor: pointer; transition: all 0.2s ease; font-family: inherit; }
.flow-btn:hover { color: var(--text-main); background: rgba(0,0,0,0.02); }
.multi-drop { display: flex; gap: -4px; align-items: center; }
.multi-drop svg:nth-child(2) { margin-left: -8px; }

/* Active Segment States - More Differentiable */
.flow-btn { border: 1px solid transparent; } /* Prevents shifting */

.flow-btn.active { 
    background: var(--bg-element); 
    border: 1px solid var(--primary); 
    box-shadow: 0 4px 12px var(--primary-glow); 
    color: var(--primary) !important; 
    transform: scale(1.05); 
    z-index: 2;
}

.delete-btn { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--border-color); background: transparent; color: var(--text-muted); font-weight: 600; cursor: pointer; margin-top: 16px; transition: 0.2s; font-family: inherit; }
.delete-btn:hover { background: #fee2e2; color: #e53e3e; border-color: #fecaca; }

/* Sync Center */
.sync-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; position: relative; }
.sync-header h3 { margin: 0; font-size: 1.1rem; }
.radar-ring { width: 20px; height: 20px; border-radius: 50%; background: var(--fertile-border); position: absolute; right: 0; opacity: 0; pointer-events: none; }
.sync-active .radar-ring { animation: radar 2s infinite ease-out; }
.sync-active .google-btn svg { animation: spin 4s linear infinite; }

.hint { margin: 0 0 20px 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.google-btn { width: 100%; padding: 14px; border-radius: 14px; border: 1px solid var(--border-color); background: var(--bg-element); color: var(--text-main); display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; cursor: pointer; transition: 0.2s; font-family: inherit; box-shadow: var(--shadow-sm); }
.google-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Onboarding Overhaul */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; transition: opacity 0.3s; }
.onboarding-card { 
    background: var(--glass-bg); 
    backdrop-filter: blur(20px); 
    border: 1px solid var(--glass-border); 
    padding: 40px; 
    border-radius: 30px; 
    max-width: 480px; 
    width: 90%; 
    text-align: center; 
    box-shadow: var(--shadow-lg);
    
    /* NEW: Fixes the cutoff issue */
    max-height: 90vh; /* Limits height to 90% of the screen */
    overflow-y: auto; /* Adds a scrollbar if content is too tall */
    box-sizing: border-box; /* Ensures padding doesn't break the height */
}

/* Optional: Makes the scrollbar look sleek and modern inside the modal */
.onboarding-card::-webkit-scrollbar {
    width: 6px;
}
.onboarding-card::-webkit-scrollbar-track {
    background: transparent;
}
.onboarding-card::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}.step-indicator { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.step { width: 30px; height: 6px; border-radius: 3px; background: var(--border-color); transition: 0.3s; }
.step.active { background: var(--primary); width: 50px; }

.onboarding-card h2 { margin: 0 0 8px 0; font-size: 1.8rem; }
.subtitle { color: var(--text-muted); margin: 0 0 30px 0; }

.onboarding-options { display: flex; gap: 16px; margin-bottom: 20px; }
.opt-btn { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 24px 16px; border: 2px solid var(--border-color); border-radius: 20px; background: var(--bg-element); cursor: pointer; transition: all 0.2s; color: var(--text-main); font-family: inherit; }
.opt-icon { font-size: 2.5rem; margin-bottom: 12px; }
.opt-btn strong { font-size: 1.1rem; margin-bottom: 6px; }
.opt-btn span { font-size: 0.75rem; color: var(--text-muted); line-height: 1.3; }
.opt-btn:hover { border-color: var(--primary-glow); transform: translateY(-2px); }
.opt-btn.active { border-color: var(--primary); background: var(--primary-glow); box-shadow: var(--shadow-sm); }

.setup-form { animation: fadeIn 0.4s ease-out; }
.instructions { font-weight: 600; margin-bottom: 16px; }
.mini-cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-weight: 700; }
.mini-grid .day-cell { border-radius: 10px; height: 36px; font-size: 0.85rem; }

.quick-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; text-align: left; }
.input-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.input-group input { width: 100%; box-sizing: border-box; padding: 12px 16px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-element); color: var(--text-main); font-family: inherit; outline: none; transition: 0.2s; }
.input-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.primary-btn { width: 100%; padding: 16px; border-radius: 16px; border: none; background: var(--primary); color: white; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 24px; transition: all 0.2s; box-shadow: 0 4px 12px var(--primary-glow); font-family: inherit; }
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 16px var(--primary-glow); }

.hidden { display: none !important; }
.desktop-hidden { display: none !important; }



/* --- Calendar Cell Fluid Overrides --- */
.calendar-wrapper {
    position: relative;
    z-index: 1;
}

#calendarFluidCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* Lets you click through to the grid */
}

#calendarGrid {
    position: relative;
    z-index: 1;
}

/* Make logged days transparent so the canvas fluid shows through from behind */
.day-cell.is-actual {
    background: transparent !important; 
    border: 1px solid rgba(0,0,0,0.05); /* Soft glass border */
}

/* Ensure text is readable on top of the liquid */
.day-cell.is-actual.f-medium, .day-cell.is-actual.f-heavy {
    color: #ffffff !important;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* If a logged cell is selected, keep background transparent but show selection ring */
.day-cell.selected.is-actual {
    background: transparent !important;
    box-shadow: inset 0 0 0 3px var(--selected-bg), 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* --- MOBILE NAVIGATION & LAYOUT (Ignored by Desktop) --- */
.mobile-bottom-nav { display: none; }
/* --- Dynamic Header Titles --- */
.header-mobile-logo, .header-mobile-cal { display: none; }
.header-mobile-logo { color: var(--primary); font-weight: 700; letter-spacing: -0.5px; }
.header-mobile-logo span { color: var(--text-main); font-weight: 400; }


@media (max-width: 768px) {
    .desktop-hidden { display: block !important; }

    /* Mobile Bottom Tab Bar */
    .mobile-bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        background: var(--glass-bg); backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border-color);
        z-index: 1000; justify-content: space-around; padding: 12px 0;
        padding-bottom: env(safe-area-inset-bottom, 12px); box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    }
    .mobile-bottom-nav button {
        background: none; border: none; font-family: inherit; color: var(--text-muted);
        display: flex; flex-direction: column; align-items: center; gap: 4px;
        font-size: 0.7rem; font-weight: 700; cursor: pointer; transition: 0.2s;
    }
    .mobile-bottom-nav button.active { color: var(--primary); transform: scale(1.05); }

    /* Main Flex Restructuring using display: contents magic */
    .app-shell { display: flex; flex-direction: column; padding-bottom: 80px; min-height: 100vh; overflow-x: hidden; }
    .content { display: contents; } /* Unboxes content so everything acts as siblings */
    
    /* Header Reordering - Forces 2 clear lines & drops Sync Dot below */
    .top-bar { order: 1; padding: 24px 20px 10px 20px; margin: 0; flex-direction: column; align-items: flex-start; gap: 12px; }
    .greeting { font-size: 1.5rem; }
    .date-today { font-size: 0.9rem; }
    
    /* Dashboard Tab Properties */
    .sidebar { order: 2; width: 100%; box-sizing: border-box; padding: 20px; border: none; box-shadow: none; background: transparent; backdrop-filter: none; margin: 0;}
    .logo { display: none; } /* Hidden on mobile to save space */
    .stats-box { flex-direction: row; margin-bottom: 24px; }
    .stat-pill { flex: 1; padding: 12px 10px; }
    .stat-info strong { font-size: 1rem; }
    
    /* Scale down generative ring slightly to fit nicely */
    .cycle-ring-container { margin: 0 auto 20px auto; width: 220px; height: 220px; transform: scale(0.9); }
    #auraCanvas { width: 220px; height: 220px; }
    
    /* Hide the old "Dashboard" button from the list to avoid confusion */
    .sidebar-nav > button.active { display: none; }

    /* Calendar Tab Properties */
    .dashboard-grid { order: 3; padding: 10px 20px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
    .card { padding: 20px 16px; border-radius: 20px; }
    
    /* Shrinking Calendar to fit screen nicely */
    .cal-header h2 { font-size: 1.2rem; }
    .calendar-grid { gap: 6px; }
    .day-cell { border-radius: 12px; font-size: 0.85rem; }
    .legend { gap: 10px; font-size: 0.75rem; margin-top: 16px; padding-top: 16px; }

    /* Squishing the Logging Area below the Calendar */
    .log-card h3 { margin-bottom: 12px; font-size: 1rem; }
    .empty-state { padding: 10px 0; }
    .empty-state svg { width: 32px; height: 32px; margin-bottom: 8px; }
    .empty-state p { margin: 0; font-size: 0.8rem; }
    .flow-selector { padding: 4px; }
    .flow-btn { padding: 8px; font-size: 0.75rem; border-radius: 10px; }
    .delete-btn { margin-top: 10px; padding: 10px; font-size: 0.85rem; }

    /* Hiding the Large Sync Card entirely (Relying only on the green dot in Top Header) */
    .sync-card { display: none !important; }

    /* TAB TOGGLE LOGIC - Controls what is hidden based on current tab */
    body[data-mobile-tab="dashboard"] .dashboard-grid { display: none !important; }
    body[data-mobile-tab="calendar"] .sidebar { display: none !important; }
    
    /* NEW: Mobile Header Dynamic Toggle */
    .header-desktop-title { display: none; } /* Always hide desktop title on mobile */
    
    /* On Dashboard: Show Logo, Hide Calendar Title */
    body[data-mobile-tab="dashboard"] .header-mobile-logo { display: inline; font-size: 1.6rem; }
    body[data-mobile-tab="dashboard"] .header-mobile-cal { display: none; }
    
    /* On Calendar: Show Calendar Title, Hide Logo */
    body[data-mobile-tab="calendar"] .header-mobile-logo { display: none; }
    body[data-mobile-tab="calendar"] .header-mobile-cal { display: inline; }
}
/* --- PWA INSTALL UI --- */
.install-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white !important;
    box-shadow: 0 4px 12px var(--primary-glow);
    margin-bottom: 8px; /* Separates it from theme settings */
}

.install-btn svg {
    stroke: white;
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.ios-modal {
    max-width: 400px;
}

.ios-instructions {
    text-align: left;
    background: var(--bg-element);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.ios-instructions p {
    margin: 12px 0;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}
/* --- DEVELOPER CREDITS --- */
.developer-credits {
    margin-top: 24px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.developer-credits:hover {
    opacity: 1; /* Brightens up slightly when someone hovers over it */
}

.developer-credits span {
    color: var(--primary); /* Makes your names match the theme color (Pink/Red/Purple) */
    font-weight: 700;
    letter-spacing: 0px;
    text-transform: none; /* Keeps your usernames lowercase and clean */
}