/* ========================================
   HABIT FLOW - PHASE 3 UI ENHANCEMENTS
   Version: 5.3.0
   
   CONTENTS:
   1. Enhanced Visual Design (Part 1)
   2. Advanced Interactions (Part 2)
   3. Bug Fixes & Theme Compatibility
   4. Stat Card Readability Fixes
   5. ADHD-Optimized Stats
   
   Load Order: After styles.css, before phase3-mobile.css
   ======================================== */

/* ========================================
   SECTION 1: ENHANCED VISUAL DESIGN
   From: phase3-enhancements-part1.css
   ======================================== */

/* ========================================
   PHASE 3: AESTHETIC ENHANCEMENTS - PART 1
   Quick Wins: Improved Shadows, Gradients, & Micro-interactions
   ======================================== */

/* Enhanced CSS Variables with More Nuance */
:root {
    /* Refined Color Palette */
    --color-bg: #0a0e1a;
    --color-bg-secondary: #0f172a;
    --color-surface: #1a1f35;
    --color-surface-hover: #242a42;
    --color-surface-light: #2d3548;
    
    --color-primary: #f59e0b;
    --color-primary-light: #fbbf24;
    --color-primary-dark: #d97706;
    
    --color-success: #10b981;
    --color-success-light: #34d399;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    
    --color-text: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-text-subtle: #64748b;
    
    --color-border: #2d3548;
    --color-border-light: #3f4968;
    
    /* Enhanced Shadow System */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.7);
    
    /* Glow Effects */
    --glow-primary: 0 0 20px rgba(245, 158, 11, 0.3);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.3);
    
    /* Animation Timing */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   ENHANCED BUTTON INTERACTIONS
   ======================================== */

.btn-primary {
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow-xs);
}

/* ========================================
   IMPROVED HABIT CARDS
   ======================================== */

.habit-card {
    position: relative;
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-secondary) 100%);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.habit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.habit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--color-surface-hover) 0%, var(--color-surface) 100%);
}

.habit-card:hover::before {
    opacity: 1;
}

.habit-card.completed {
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.15) 0%, 
        rgba(16, 185, 129, 0.05) 100%);
    border-color: var(--color-success);
    box-shadow: var(--shadow-md), var(--glow-success);
}

/* ========================================
   ENHANCED STATS CARDS
   ======================================== */

.stat-card {
    position: relative;
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-secondary) 100%);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    transition: transform var(--transition-bounce);
}

.stat-card:hover .stat-value {
    transform: scale(1.1);
}

/* ========================================
   IMPROVED CHECK BUTTON WITH RIPPLE
   ======================================== */

.btn-check {
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.btn-check::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-check:active::before {
    width: 80px;
    height: 80px;
}

.btn-check:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: var(--shadow-lg), var(--glow-success);
}

.btn-check.checked {
    animation: checkPulse 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ========================================
   GLASSMORPHISM MODAL BACKGROUND
   ======================================== */

.modal-overlay {
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-content {
    background: linear-gradient(135deg, 
        rgba(26, 31, 53, 0.95) 0%, 
        rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: var(--shadow-xl), var(--glow-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ========================================
   ENHANCED ICON SELECTOR
   ======================================== */

.icon-btn {
    background: var(--color-bg);
    transition: all var(--transition-base);
    position: relative;
}

.icon-btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-base);
}

.icon-btn.selected::after {
    opacity: 1;
}

.icon-btn:hover {
    transform: scale(1.15) rotate(-5deg);
    box-shadow: var(--shadow-md);
}

.icon-btn.selected {
    transform: scale(1.1);
    background: var(--color-surface);
    border-color: transparent;
}

/* ========================================
   IMPROVED INPUT FIELDS
   ======================================== */

.input-field {
    background: var(--color-bg);
    transition: all var(--transition-base);
    position: relative;
}

.input-field:focus {
    background: var(--color-surface);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15), var(--shadow-md);
    transform: translateY(-1px);
}

/* ========================================
   ENHANCED WEEKLY CALENDAR
   ======================================== */

.day-column {
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.day-column::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.day-column:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.day-column:hover::before {
    transform: scaleX(1);
}

.day-column.today {
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.1) 0%, 
        rgba(245, 158, 11, 0.05) 100%);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm), var(--glow-primary);
}

/* ========================================
   SMOOTH PAGE TRANSITIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for habit cards */
.habit-card:nth-child(1) { animation-delay: 0ms; }
.habit-card:nth-child(2) { animation-delay: 50ms; }
.habit-card:nth-child(3) { animation-delay: 100ms; }
.habit-card:nth-child(4) { animation-delay: 150ms; }
.habit-card:nth-child(5) { animation-delay: 200ms; }
.habit-card:nth-child(6) { animation-delay: 250ms; }

/* ========================================
   ENHANCED EMPTY STATE
   ======================================== */

.empty-state {
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.05) 0%, 
        transparent 100%);
    border-radius: 24px;
    border: 2px dashed var(--color-border);
    padding: 4rem 2rem;
    transition: all var(--transition-base);
}

.empty-state:hover {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.1) 0%, 
        transparent 100%);
}

.empty-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ========================================
   IMPROVED SETTINGS BUTTON
   ======================================== */

.btn-settings {
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.btn-settings::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-base);
}

.btn-settings:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

.btn-settings:hover::before {
    opacity: 0.2;
}

/* ========================================
   CATEGORY PILL IMPROVEMENTS
   ======================================== */

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--color-primary);
    transition: all var(--transition-base);
}

.category-badge:hover {
    background: rgba(245, 158, 11, 0.2);
    transform: scale(1.05);
}

/* ========================================
   PROGRESS BAR ENHANCEMENTS
   ======================================== */

.progress-bar {
    height: 8px;
    background: var(--color-bg);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   TOOLTIP STYLING
   ======================================== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 0.5rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--color-surface);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   LOADING SKELETON
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, 
        var(--color-surface) 0%, 
        var(--color-surface-light) 50%, 
        var(--color-surface) 100%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   RESPONSIVE ENHANCEMENTS
   ======================================== */

@media (max-width: 768px) {
    /* Larger touch targets */
    .btn-check,
    .btn-delete {
        width: 52px;
        height: 52px;
    }
    
    /* Better spacing on mobile */
    .habit-card {
        padding: 1.25rem;
    }
    
    /* Improved stat cards */
    .stat-card {
        padding: 1.25rem;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus visible improvements */
*:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-border: #64748b;
        --color-text-muted: #cbd5e1;
    }
}
/* ========================================
   PHASE 3: AESTHETIC ENHANCEMENTS - PART 2
   Advanced Effects: Confetti, Particles, & Celebrations
   ======================================== */

/* ========================================
   STREAK MILESTONE CELEBRATION
   ======================================== */

/* Confetti container (add to HTML when milestone reached) */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Individual confetti pieces */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    opacity: 0;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-100vh) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Different confetti colors */
.confetti:nth-child(1) { background: #f59e0b; left: 10%; animation-delay: 0s; }
.confetti:nth-child(2) { background: #10b981; left: 20%; animation-delay: 0.1s; }
.confetti:nth-child(3) { background: #3b82f6; left: 30%; animation-delay: 0.2s; }
.confetti:nth-child(4) { background: #ef4444; left: 40%; animation-delay: 0.3s; }
.confetti:nth-child(5) { background: #8b5cf6; left: 50%; animation-delay: 0.4s; }
.confetti:nth-child(6) { background: #ec4899; left: 60%; animation-delay: 0.5s; }
.confetti:nth-child(7) { background: #f59e0b; left: 70%; animation-delay: 0.6s; }
.confetti:nth-child(8) { background: #10b981; left: 80%; animation-delay: 0.7s; }
.confetti:nth-child(9) { background: #3b82f6; left: 90%; animation-delay: 0.8s; }

/* ========================================
   PARTICLE BURST ON COMPLETION
   ======================================== */

.particle-burst {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    top: 0;
    left: 0;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success);
    opacity: 0;
    animation: particleBurst 0.8s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Generate 8 particles in different directions */
.particle:nth-child(1) { --tx: 40px; --ty: 0px; }
.particle:nth-child(2) { --tx: 28px; --ty: 28px; }
.particle:nth-child(3) { --tx: 0px; --ty: 40px; }
.particle:nth-child(4) { --tx: -28px; --ty: 28px; }
.particle:nth-child(5) { --tx: -40px; --ty: 0px; }
.particle:nth-child(6) { --tx: -28px; --ty: -28px; }
.particle:nth-child(7) { --tx: 0px; --ty: -40px; }
.particle:nth-child(8) { --tx: 28px; --ty: -28px; }

/* ========================================
   STREAK FLAME ANIMATION
   ======================================== */

.streak-flame {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.streak-flame .flame-icon {
    display: inline-block;
    animation: flameFlicker 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

@keyframes flameFlicker {
    0%, 100% { 
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
    }
    50% { 
        transform: scale(1.1) translateY(-2px);
        filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.8));
    }
}

/* Milestone flame effects */
.streak-milestone-7 .flame-icon {
    animation: flameMilestone 1s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.8));
}

.streak-milestone-30 .flame-icon {
    animation: flameMilestone 0.8s ease-in-out infinite;
    filter: drop-shadow(0 0 16px rgba(245, 158, 11, 1));
}

.streak-milestone-100 .flame-icon {
    animation: flameMilestone 0.6s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 1));
}

@keyframes flameMilestone {
    0%, 100% { transform: scale(1) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); }
}

/* ========================================
   CIRCULAR PROGRESS INDICATOR
   ======================================== */

.circular-progress {
    position: relative;
    width: 80px;
    height: 80px;
}

.circular-progress svg {
    transform: rotate(-90deg);
}

.circular-progress-bg {
    fill: none;
    stroke: var(--color-bg);
    stroke-width: 8;
}

.circular-progress-bar {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 251.2; /* 2 * PI * 40 */
    stroke-dashoffset: 251.2;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   ACHIEVEMENT BADGE
   ======================================== */

.achievement-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    border-radius: 50%;
    box-shadow: var(--shadow-lg), var(--glow-primary);
    position: relative;
    animation: badgeAppear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badgeAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(20deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.achievement-badge::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    opacity: 0.3;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.1;
    }
}

.achievement-badge-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-secondary) 100%);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s ease-out forwards;
}

@keyframes toastSlideOut {
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.toast-message {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.toast.toast-success {
    border-left-color: var(--color-success);
}

.toast.toast-error {
    border-left-color: var(--color-error);
}

.toast.toast-warning {
    border-left-color: var(--color-warning);
}

/* ========================================
   HABIT COMPLETION ANIMATION
   ======================================== */

.habit-card.completing {
    animation: habitComplete 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes habitComplete {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.05) rotate(2deg);
    }
    50% {
        transform: scale(0.95) rotate(-2deg);
    }
    75% {
        transform: scale(1.02) rotate(1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* ========================================
   WEEKLY HEATMAP ENHANCED
   ======================================== */

.heatmap-cell {
    position: relative;
    background: var(--color-bg);
    border-radius: 6px;
    aspect-ratio: 1;
    transition: all var(--transition-base);
    cursor: pointer;
}

.heatmap-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.heatmap-cell:hover::before {
    opacity: 0.2;
}

/* Intensity levels */
.heatmap-cell.intensity-0 { background: var(--color-bg); }
.heatmap-cell.intensity-1 { background: rgba(245, 158, 11, 0.2); }
.heatmap-cell.intensity-2 { background: rgba(245, 158, 11, 0.4); }
.heatmap-cell.intensity-3 { background: rgba(245, 158, 11, 0.6); }
.heatmap-cell.intensity-4 { background: rgba(245, 158, 11, 0.8); }
.heatmap-cell.intensity-5 { background: rgba(245, 158, 11, 1); }

.heatmap-cell:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

/* ========================================
   ANIMATED COUNTER
   ======================================== */

.animated-counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    transition: transform var(--transition-bounce);
}

.animated-counter.counting-up {
    animation: countUp 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes countUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   PULSE GLOW EFFECT
   ======================================== */

.pulse-glow {
    position: relative;
}

.pulse-glow::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    opacity: 0;
    animation: pulseGlow 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.05);
    }
}

/* ========================================
   SPARKLE EFFECT
   ======================================== */

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: sparkle 1.5s ease-out infinite;
}

@keyframes sparkle {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.5) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(360deg);
    }
}

.sparkle:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 80%; left: 80%; animation-delay: 0.3s; }
.sparkle:nth-child(3) { top: 50%; left: 90%; animation-delay: 0.6s; }
.sparkle:nth-child(4) { top: 20%; left: 70%; animation-delay: 0.9s; }

/* ========================================
   SMOOTH NUMBER TRANSITION
   ======================================== */

@keyframes numberChange {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(-10px);
        opacity: 0;
    }
}

.number-transition {
    display: inline-block;
    animation: numberChange 0.4s ease-out;
}

/* ========================================
   CATEGORY COLOR HIGHLIGHTS
   ======================================== */

.habit-card[data-category="health"] {
    border-left: 4px solid #10b981;
}

.habit-card[data-category="productivity"] {
    border-left: 4px solid #3b82f6;
}

.habit-card[data-category="learning"] {
    border-left: 4px solid #8b5cf6;
}

.habit-card[data-category="fitness"] {
    border-left: 4px solid #f59e0b;
}

.habit-card[data-category="mindfulness"] {
    border-left: 4px solid #ec4899;
}

.habit-card[data-category="social"] {
    border-left: 4px solid #14b8a6;
}

/* ========================================
   LOADING SHIMMER EFFECT
   ======================================== */

.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ========================================
   FLOATING LABEL EFFECT
   ======================================== */

.form-group-floating {
    position: relative;
}

.form-group-floating input {
    padding-top: 1.5rem;
}

.form-group-floating label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    transition: all var(--transition-base);
    pointer-events: none;
    color: var(--color-text-muted);
}

.form-group-floating input:focus + label,
.form-group-floating input:not(:placeholder-shown) + label {
    top: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-primary);
}

/* ========================================
   STREAK MILESTONE BADGES
   ======================================== */

.milestone-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(251, 191, 36, 0.1));
    border: 1px solid var(--color-primary);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    animation: badgeSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badgeSlideIn {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.milestone-badge-icon {
    font-size: 1.25rem;
    animation: rotateIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s backwards;
}

@keyframes rotateIn {
    from {
        transform: rotate(-180deg) scale(0);
    }
    to {
        transform: rotate(0deg) scale(1);
    }
}

/* ========================================
   SUCCESS CHECKMARK ANIMATION
   ======================================== */

.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid var(--color-success);
}

.success-checkmark .check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.success-checkmark .check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotateCircle 4.25s ease-in;
}

.success-checkmark .check-icon::before,
.success-checkmark .check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    background: var(--color-bg);
    transform: rotate(-45deg);
}

.success-checkmark .icon-line {
    height: 5px;
    background-color: var(--color-success);
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.success-checkmark .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: iconLineTip 0.75s;
}

.success-checkmark .icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: iconLineLong 0.75s;
}

@keyframes rotateCircle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

@keyframes iconLineTip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 45px;
    }
}

@keyframes iconLineLong {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}
/* ========================================
   PHASE 3 FIXES - Addressing User Feedback
   ======================================== */

/* ========================================
   FIX 1: ALL BUTTONS GET TILT/RIPPLE
   Make edit and delete buttons consistent
   ======================================== */

/* Apply ripple to ALL buttons */
.btn-check,
.btn-delete,
.btn-edit,
.btn-primary,
.btn-secondary,
.btn-add-habit,
.icon-btn,
.category-btn,
.tracking-type-btn,
.color-btn {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

/* Ripple effect for all buttons */
.btn-check::before,
.btn-delete::before,
.btn-edit::before,
.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
    pointer-events: none;
}

/* Tilt effect on hover for ALL action buttons */
.btn-check:hover,
.btn-delete:hover,
.btn-edit:hover {
    transform: scale(1.05) rotate(-2deg);
}

.btn-check:active::before,
.btn-delete:active::before,
.btn-edit:active::before {
    width: 80px;
    height: 80px;
}

/* ========================================
   FIX 2: REMOVE DISTRACTING GRADIENTS ON STATS
   Use theme colors instead of fixed gradient
   ======================================== */

/* Remove fixed gradient, use theme variable */
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    /* OLD: Fixed gradient */
    /* background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%); */
    /* NEW: Use theme's primary color */
    color: var(--color-primary);
    display: block;
    transition: transform var(--transition-bounce);
}

/* Optional subtle text shadow instead of gradient */
.stat-value {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ========================================
   FIX 3: ADHD THEME COMPATIBILITY
   Respect theme colors, don't override
   ======================================== */

/* Remove gradients from incomplete habit cards */
.habit-card {
    /* OLD: Fixed gradient background */
    /* background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-secondary) 100%); */
    
    /* NEW: Use theme's surface color directly */
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

/* Keep gradient ONLY for completed cards (green = success) */
.habit-card.completed {
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.15) 0%, 
        rgba(16, 185, 129, 0.05) 100%);
    border-color: var(--color-success);
    box-shadow: var(--shadow-md), var(--glow-success);
}

/* ========================================
   FIX 4: THEME-AWARE STAT CARDS
   Use theme colors, not fixed gradients
   ======================================== */

.stat-card {
    position: relative;
    /* OLD: Fixed gradient */
    /* background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-secondary) 100%); */
    
    /* NEW: Theme color */
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
}

/* Subtle hover glow instead of gradient background */
.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--color-primary-alpha) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.stat-card:hover::after {
    opacity: 0.15; /* Very subtle */
}

/* ========================================
   FIX 5: BETTER MODAL BACKGROUND DEMO
   Make blur more visible for testing
   ======================================== */

/* Ensure modal overlay has visible blur */
.modal-overlay {
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Make modal content more transparent to show blur */
.modal-content {
    background: rgba(26, 31, 53, 0.92);
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Add visual indicator that blur is active */
.modal-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* ========================================
   FIX 6: ADHD THEME VARIABLE SUPPORT
   Add CSS variables for better theme integration
   ======================================== */

/* Define alpha (transparent) versions of colors for subtle effects */
:root {
    --color-primary-alpha: rgba(245, 158, 11, 0.1);
    --color-success-alpha: rgba(16, 185, 129, 0.1);
    --color-text-alpha: rgba(241, 245, 249, 0.1);
}

/* Update when theme changes - these will be overridden by theme CSS */
/* Light themes */
[data-theme="light-dawn"],
[data-theme="light-mint"],
[data-theme="light-lavender"],
[data-theme="light-peach"] {
    --color-primary-alpha: rgba(var(--color-primary-rgb), 0.15);
    --color-success-alpha: rgba(var(--color-success-rgb), 0.15);
}

/* ========================================
   FIX 7: SUBTLE STAT NUMBER STYLING
   Remove gradient, use theme color
   ======================================== */

/* Better stat value styling without gradient */
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    display: block;
    transition: transform var(--transition-bounce);
    /* Remove gradient clip */
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

/* Add subtle glow on hover instead of scale */
.stat-card:hover .stat-value {
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px var(--color-primary-alpha));
}

/* ========================================
   FIX 8: IMPROVED HOVER STATES
   Consistent across all themes
   ======================================== */

.habit-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    /* Remove background change, keep theme color */
    background: var(--color-surface);
    border-color: var(--color-primary);
}

/* Top accent line on hover - more subtle */
.habit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.habit-card:hover::before {
    opacity: 0.6; /* Semi-transparent */
}

/* ========================================
   FIX 9: PROGRESS BAR THEME COMPATIBILITY
   ======================================== */

.progress-fill {
    height: 100%;
    /* OLD: Fixed gradient */
    /* background: linear-gradient(90deg, var(--color-primary), var(--color-success)); */
    
    /* NEW: Use theme primary color */
    background: var(--color-primary);
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Keep shimmer effect but make it subtle */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    animation: shimmer 2s infinite;
}

/* ========================================
   FIX 10: BETTER BUTTON HOVER FEEDBACK
   Make all buttons tilt slightly
   ======================================== */

/* Edit button - add to habit cards */
.btn-edit {
    background: var(--color-surface-light);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.btn-edit:hover {
    background: var(--color-border);
    transform: scale(1.1) rotate(-3deg);
    border-color: var(--color-primary);
}

/* Delete button - consistent tilt */
.btn-delete:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: scale(1.1) rotate(3deg); /* Opposite direction */
}

/* ========================================
   FIX 11: THEME COLOR VARIABLES
   Make gradients use theme colors
   ======================================== */

/* For themes that define RGB values */
:root {
    /* Default (will be overridden by themes) */
    --color-primary-rgb: 245, 158, 11;
    --color-success-rgb: 16, 185, 129;
    --color-surface-rgb: 26, 31, 53;
}

/* Use RGB variables for alpha transparency */
.stat-card::after {
    background: radial-gradient(
        circle, 
        rgba(var(--color-primary-rgb), 0.15) 0%, 
        transparent 70%
    );
}

/* ========================================
   FIX 12: ADHD THEME - REMOVE DISTRACTIONS
   Disable unnecessary animations for ADHD themes
   ======================================== */

/* Add class to body for ADHD themes */
body[data-adhd-mode="true"] .stat-value,
body[data-adhd-mode="true"] .progress-fill::after,
body[data-adhd-mode="true"] .shimmer {
    animation: none !important;
}

/* Simpler hover states for ADHD themes */
body[data-adhd-mode="true"] .habit-card:hover {
    transform: translateY(-2px); /* Less dramatic */
}

body[data-adhd-mode="true"] .btn-check:hover,
body[data-adhd-mode="true"] .btn-delete:hover,
body[data-adhd-mode="true"] .btn-edit:hover {
    transform: scale(1.05) rotate(0deg); /* No rotation */
}

/* ========================================
   TESTING: MODAL BLUR VISIBILITY
   ======================================== */

/* To test modal blur, add this class to your modal */
.modal-blur-test {
    /* Strong background for visibility */
    background: rgba(26, 31, 53, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* Add pattern to show blur is working */
.modal-blur-test::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.02) 10px,
            rgba(255, 255, 255, 0.02) 20px
        );
    pointer-events: none;
}

/* ========================================
   SUMMARY OF FIXES
   ======================================== */

/*
FIX 1: ✅ All buttons now tilt (edit, delete, check, etc.)
FIX 2: ✅ Stat gradients removed - uses theme colors
FIX 3: ✅ Habit cards use theme colors, not fixed gradients
FIX 4: ✅ Stat cards respect theme
FIX 5: ✅ Modal blur more visible
FIX 6: ✅ ADHD theme compatibility
FIX 7: ✅ No distracting gradients on numbers
FIX 8: ✅ Consistent hover states
FIX 9: ✅ Progress bars use theme colors
FIX 10: ✅ All buttons have consistent feedback
FIX 11: ✅ Theme-aware alpha transparency
FIX 12: ✅ ADHD mode disables distracting animations
*/
/* ========================================
   PHASE 3 ADDITIONAL FIXES - Round 2
   Addressing: Stats readability, button positioning, mobile layout
   ======================================== */

/* ========================================
   FIX 1: STAT CARDS - REMOVE GRADIENT BACKGROUND
   Make numbers clearly readable on theme backgrounds
   ======================================== */

.stat-card {
    position: relative;
    /* Remove gradient background completely */
    background: var(--color-surface) !important;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: visible; /* Changed from hidden to allow text to be clear */
}

/* Remove the gradient overlay completely */
.stat-card::after {
    display: none !important;
}

/* Make stat values use solid theme color - no gradient, no clip */
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    /* Use solid color from theme */
    color: var(--color-primary) !important;
    display: block;
    transition: transform var(--transition-bounce);
    
    /* Remove all gradient/clip effects */
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    text-shadow: none !important;
}

/* Simple hover effect - no gradient */
.stat-card:hover .stat-value {
    transform: scale(1.05);
}

/* Stat label should be readable */
.stat-label {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* ========================================
   FIX 2: NEW HABIT BUTTON - DESKTOP ALIGNMENT
   Keep button properly aligned on desktop
   ======================================== */

/* Desktop: Button should be inline, not floating */
.btn-add-habit {
    /* Reset any fixed/absolute positioning for desktop */
    position: static;
    width: auto;
    height: auto;
    border-radius: 12px;
    padding: 1rem 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-habit .btn-icon {
    font-size: 1.5rem;
}

/* Keep text visible on desktop */
.btn-add-habit span:not(.btn-icon) {
    display: inline;
}

/* Container for add habit section */
.add-habit-section {
    text-align: center;
    margin-bottom: 2rem;
}

/* ========================================
   FIX 3: MOBILE - FLOATING ACTION BUTTON (FAB)
   Bottom-right position for easy thumb access
   ======================================== */

@media (max-width: 768px) {
    /* Make button a floating action button (FAB) on mobile */
    .btn-add-habit {
        position: fixed !important;
        bottom: 24px !important;
        right: 24px !important;
        width: 64px !important;
        height: 64px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 999 !important;
        box-shadow: var(--shadow-xl) !important;
    }

    /* Larger icon on mobile */
    .btn-add-habit .btn-icon {
        font-size: 2rem !important;
        margin: 0 !important;
    }

    /* Hide text on mobile - just show + icon */
    .btn-add-habit span:not(.btn-icon) {
        display: none !important;
    }

    /* Adjust for safe area (iOS notch) */
    @supports (padding: max(0px)) {
        .btn-add-habit {
            bottom: max(24px, calc(env(safe-area-inset-bottom) + 24px)) !important;
            right: max(24px, calc(env(safe-area-inset-right) + 24px)) !important;
        }
    }

    /* Hide the add-habit-section container on mobile */
    .add-habit-section {
        display: none;
    }
}

/* Tablet size - keep FAB but slightly smaller */
@media (min-width: 769px) and (max-width: 1024px) {
    .btn-add-habit {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        width: 56px !important;
        height: 56px !important;
        border-radius: 50% !important;
        z-index: 999 !important;
    }

    .btn-add-habit span:not(.btn-icon) {
        display: none !important;
    }
}

/* ========================================
   FIX 4: STAT CARD HOVER - SIMPLE & CLEAN
   Remove distracting effects
   ======================================== */

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    /* No background change - keep it clean */
    background: var(--color-surface) !important;
}

/* ========================================
   FIX 5: ENSURE TEXT CONTRAST
   Make sure all text is readable on theme backgrounds
   ======================================== */

/* Force proper contrast for stat values */
.stat-card .stat-value {
    /* Ensure color from theme is used */
    color: var(--color-primary) !important;
    opacity: 1 !important;
}

/* Labels should be visible */
.stat-card .stat-label {
    color: var(--color-text-muted) !important;
    opacity: 1 !important;
}

/* ========================================
   FIX 6: MOBILE SPACING ADJUSTMENTS
   Ensure content doesn't hide behind FAB
   ======================================== */

@media (max-width: 768px) {
    /* Add padding at bottom to prevent FAB from covering content */
    .container {
        padding-bottom: 100px;
    }

    /* Adjust habits list */
    .habits-section {
        margin-bottom: 2rem;
    }
}

/* ========================================
   FIX 7: GRADIENT REMOVAL - ADDITIONAL OVERRIDES
   Make absolutely sure no gradients interfere with readability
   ======================================== */

/* Override any gradient backgrounds on stat cards */
.stat-card,
.stat-card:hover,
.stat-card:focus {
    background: var(--color-surface) !important;
    background-image: none !important;
}

/* Remove any pseudo-element gradients */
.stat-card::before,
.stat-card::after {
    background: none !important;
    background-image: none !important;
    opacity: 0 !important;
    display: none !important;
}

/* ========================================
   FIX 8: LIGHT THEME SPECIFIC FIXES
   Better contrast for light themes
   ======================================== */

/* Light themes need stronger borders */
[data-theme*="light"] .stat-card {
    border: 2px solid var(--color-border);
}

/* Ensure stat values are visible on light backgrounds */
[data-theme*="light"] .stat-value {
    color: var(--color-primary) !important;
    font-weight: 800; /* Heavier weight for light themes */
}

/* ========================================
   FIX 9: SETTINGS BUTTON MOBILE POSITION
   Keep settings accessible on mobile
   ======================================== */

@media (max-width: 768px) {
    .btn-settings {
        position: fixed;
        top: 16px;
        right: 16px;
        z-index: 1000;
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   FIX 10: RESPONSIVE LAYOUT IMPROVEMENTS
   Smooth transitions between desktop and mobile
   ======================================== */

/* Ensure smooth transition when resizing */
.btn-add-habit {
    transition: all 0.3s ease;
}

/* Medium screens - button transitions to FAB */
@media (max-width: 1024px) and (min-width: 769px) {
    .btn-add-habit {
        /* Smaller but still has text */
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ========================================
   SUMMARY OF FIXES
   ======================================== */

/*
FIX 1: ✅ Stat cards use solid theme background (no gradient)
FIX 2: ✅ Stat values use solid theme color (readable)
FIX 3: ✅ Desktop: Button inline and centered
FIX 4: ✅ Mobile: Floating action button bottom-right
FIX 5: ✅ Tablet: Smaller FAB, still accessible
FIX 6: ✅ Text contrast ensured on all themes
FIX 7: ✅ No gradient overlays interfering
FIX 8: ✅ Light theme optimizations
FIX 9: ✅ Settings button positioned correctly
FIX 10: ✅ Smooth responsive transitions
*/
/* ========================================
   ADHD-OPTIMIZED STAT CARDS - FINAL CORRECT
   - Stats: Left border accent
   - Habits: Keep category left border, NO top bar
   ======================================== */

/* ========================================
   HABIT CARDS: REMOVE ONLY THE TOP BAR
   Keep the category left border, remove top hover bar
   ======================================== */

/* Block the top horizontal bar that appears on hover */
.habit-card::before {
    display: none !important;
    content: none !important;
}

/* Block the glow effect */
.habit-card::after {
    display: none !important;
    content: none !important;
}

/* Keep original padding (don't add extra for stats border) */
.habit-card {
    padding: 1.5rem !important;
}

/* ========================================
   TARGET ONLY STATS BAR CARDS
   ======================================== */

.stats-bar .stat-card {
    position: relative !important;
    background: var(--color-surface) !important;
    
    box-shadow: 
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    
    border: 1px solid var(--color-border) !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    padding-left: 1.75rem !important; /* Extra space for left border */
    transition: all var(--transition-base) !important;
    overflow: hidden !important;
    isolation: isolate !important;
}

/* LEFT BORDER ACCENT - Only stats-bar */
.stats-bar .stat-card::before {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 4px !important;
    height: 100% !important;
    background: var(--color-primary) !important;
    opacity: 0.7 !important;
    z-index: 1 !important;
    border-radius: 16px 0 0 16px !important;
    transition: opacity 0.3s ease !important;
}

.stats-bar .stat-card:hover::before {
    opacity: 1 !important;
}

/* Glow effect - Only stats-bar */
.stats-bar .stat-card::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 150% !important;
    height: 150% !important;
    background: radial-gradient(
        circle at center, 
        rgba(245, 158, 11, 0.12) 0%, 
        transparent 60%
    ) !important;
    opacity: 0 !important;
    transform: translate(-50%, -50%) !important;
    transition: opacity 0.4s ease !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

.stats-bar .stat-card:hover::after {
    opacity: 1 !important;
}

/* Content layering */
.stats-bar .stat-value,
.stats-bar .stat-label {
    position: relative !important;
    z-index: 2 !important;
}

/* Number styling */
.stats-bar .stat-value {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: var(--color-primary) !important;
    display: block !important;
    transition: all var(--transition-base) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: currentColor !important;
    background-clip: unset !important;
}

.stats-bar .stat-card:hover .stat-value {
    transform: scale(1.05) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.12) !important;
}

/* Card hover */
.stats-bar .stat-card:hover {
    transform: translateY(-2px) !important;
    border-color: var(--color-primary) !important;
    box-shadow: var(--shadow-md) !important;
    background: var(--color-surface) !important;
}

/* Label styling */
.stats-bar .stat-label {
    color: var(--color-text-muted) !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-top: 0.5rem !important;
    opacity: 0.8 !important;
}

/* ========================================
   OPTIONAL: COLOR PER STAT TYPE
   ======================================== */

/*
.stats-bar .stat-card[data-stat="today"]::before {
    background: #10b981 !important;
}

.stats-bar .stat-card[data-stat="habits"]::before {
    background: #3b82f6 !important;
}

.stats-bar .stat-card[data-stat="streak"]::before {
    background: #f59e0b !important;
}
*/

/* ========================================
   ANIMATIONS
   ======================================== */

.stats-bar .stat-value.updating {
    animation: statUpdate 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

@keyframes statUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); color: var(--color-success); }
    100% { transform: scale(1); }
}

.stats-bar .stat-card.improved {
    animation: celebrate 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

@keyframes celebrate {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.02); }
}

.stats-bar .stat-card.improved::before {
    animation: borderPulse 0.6s ease-out !important;
}

@keyframes borderPulse {
    0%, 100% { opacity: 0.7; width: 4px; }
    50% { opacity: 1; width: 6px; }
}

/* ========================================
   LIGHT THEME
   ======================================== */

[data-theme*="light"] .stats-bar .stat-card {
    border: 2px solid var(--color-border) !important;
}

[data-theme*="light"] .stats-bar .stat-value {
    font-weight: 800 !important;
}

[data-theme*="light"] .stats-bar .stat-card::before {
    opacity: 0.85 !important;
}

[data-theme*="light"] .stats-bar .stat-card::after {
    background: radial-gradient(
        circle at center, 
        rgba(245, 158, 11, 0.15) 0%, 
        transparent 60%
    ) !important;
}

/* ========================================
   MOBILE
   ======================================== */

@media (max-width: 768px) {
    .stats-bar .stat-card {
        padding: 1.25rem !important;
        padding-left: 1.5rem !important;
    }
    
    .stats-bar .stat-value {
        font-size: 1.75rem !important;
    }
    
    .stats-bar .stat-card::before {
        width: 3px !important;
    }
    
    .stats-bar .stat-card:hover {
        transform: translateY(-1px) !important;
    }
    
    .stats-bar .stat-card:hover .stat-value {
        transform: scale(1.03) !important;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .stats-bar .stat-card,
    .stats-bar .stat-value,
    .stats-bar .stat-card::after,
    .stats-bar .stat-card::before {
        transition: none !important;
        animation: none !important;
    }
    
    .stats-bar .stat-card:hover .stat-value,
    .stats-bar .stat-card:hover {
        transform: none !important;
    }
}

/* ========================================
   LAYOUT
   ======================================== */

.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* ========================================
   SUMMARY
   ======================================== */

/*
HABIT CARDS KEEP:
✅ Category-colored LEFT border (from themes or phase3-part1.css)
✅ Theme-based border color for incomplete habits
✅ Green border for completed habits
✅ Card lift on hover
✅ Shadow changes
✅ Background changes
✅ Button hover effects
✅ All Phase 3 features

HABIT CARDS REMOVE:
❌ Top horizontal bar on hover (the one that went outside rounded border)
❌ Radial glow (stats-only feature)

STATS CARDS GET:
✅ Left 4px colored accent border
✅ Glow on hover
✅ Number scaling
✅ Border brightens on hover
✅ All ADHD optimizations

RESULT:
- Your Water card keeps its blue left border (category color)
- Completed habits keep green left border
- NO top horizontal bar appears on hover
- Stats get their own distinct left border accent
*/
/**
 * Monthly View Alignment Fix - Phase 3
 * Separated day headers from date grid for perfect alignment
 * This CSS works with the restructured UIRenderer.js
 */

/* =================================================================
   PHASE 3: MONTHLY VIEW ALIGNMENT AND THEME FIXES
   Added: January 23, 2026   
   ================================================================= */
#currentMonth {
    color: rgb(226, 232, 240) !important; /* Light slate - works for both themes since it's in dark header */
    font-weight: 600;
}

/* Keep it light even in light theme (since header area is dark) */
body.light-ocean #currentMonth,
body.light-minimal #currentMonth {
    color: rgb(226, 232, 240) !important; /* Light text for dark header */
}

/* Month navigation buttons - make them visible and prominent */
.btn-month-nav,
#btnPrevMonth,
#btnNextMonth {
    background: rgba(226, 232, 240, 0.1) !important;
    color: rgb(226, 232, 240) !important;
    border: 1px solid rgba(226, 232, 240, 0.2) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    min-width: 40px !important;
    min-height: 40px !important;
}

.btn-month-nav:hover,
#btnPrevMonth:hover,
#btnNextMonth:hover {
    background: rgba(226, 232, 240, 0.2) !important;
    border-color: rgba(226, 232, 240, 0.4) !important;
    transform: scale(1.05);
}

/* Light theme navigation buttons */
body.light-ocean .btn-month-nav,
body.light-ocean #btnPrevMonth,
body.light-ocean #btnNextMonth,
body.light-minimal .btn-month-nav,
body.light-minimal #btnPrevMonth,
body.light-minimal #btnNextMonth {
    background: rgba(255, 255, 255, 0.9) !important; /* White background for visibility */
    color: rgb(15, 23, 42) !important;
    border: 1px solid rgba(15, 23, 42, 0.2) !important;
}

body.light-ocean .btn-month-nav:hover,
body.light-ocean #btnPrevMonth:hover,
body.light-ocean #btnNextMonth:hover,
body.light-minimal .btn-month-nav:hover,
body.light-minimal #btnPrevMonth:hover,
body.light-minimal #btnNextMonth:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(15, 23, 42, 0.3) !important;
}

/* =================================================================
   HEATMAP CONTAINER - Parent wrapper
   ================================================================= */
.heatmap-container {
    margin-top: 1rem;
    width: 100%;
}

/* =================================================================
   DAY HEADERS - Separate grid for Sun-Sat labels
   ================================================================= */
.heatmap-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px; /* Increased spacing */
    padding: 0 0 8px 0; /* Add padding at bottom */
    border-bottom: 1px solid rgba(226, 232, 240, 0.15); /* Subtle separator line */
}

.heatmap-day-label {
    /* MATCH CELL DISPLAY METHOD EXACTLY */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important; /* Fill grid column like cells */
    height: 32px !important;
    
    /* Styling */
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    padding: 0 !important;
    color: rgb(226, 232, 240) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    background: transparent !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Even more specific selector */
.heatmap-container .heatmap-day-headers .heatmap-day-label {
    color: rgb(226, 232, 240) !important;
    font-weight: 700 !important;
}

/* Light theme support for day headers */
body.light-ocean .heatmap-day-label,
body.light-ocean .heatmap-container .heatmap-day-headers .heatmap-day-label,
body.light-minimal .heatmap-day-label,
body.light-minimal .heatmap-container .heatmap-day-headers .heatmap-day-label {
    color: rgb(15, 23, 42) !important; /* slate-900 - almost black */
    font-weight: 800 !important; /* Extra bold */
}

/* =================================================================
   HEATMAP GRID - Date cells (1-31)
   ================================================================= */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 1rem;
}

/* =================================================================
   HEATMAP CELLS - Individual date boxes
   ================================================================= */
.heatmap-box {
    /* Remove aspect-ratio to let cells fill grid width */
    min-height: 60px !important;
    max-height: 60px !important;
    height: 60px !important;
    width: 100%; /* Fill grid column */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Empty cells (before month starts) */
.heatmap-box.empty {
    background: transparent !important;
    cursor: default;
}

/* Future dates */
.heatmap-box.future {
    background: var(--color-surface-light) !important;
    opacity: 0.3;
    cursor: default;
}

.heatmap-box.future span {
    color: var(--color-text-muted);
}

/* Today's date - special styling */
.heatmap-box.today {
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

/* Hover effect for interactive cells */
.heatmap-box:not(.empty):not(.future):hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Date number inside cell */
.heatmap-box span {
    color: var(--color-text);
    font-weight: 600;
    position: relative;
    z-index: 2;
}

/* =================================================================
   TOOLTIPS - Show on hover
   ================================================================= */
.heatmap-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.heatmap-box:hover .heatmap-tooltip {
    opacity: 1;
}

/* Tooltip arrow */
.heatmap-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.95);
}

/* =================================================================
   LEGEND - Color intensity guide
   ================================================================= */
.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.legend-boxes {
    display: flex;
    gap: 4px;
}

.legend-box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* =================================================================
   MOBILE RESPONSIVE - Smaller cells and text
   ================================================================= */
@media (max-width: 768px) {
    .heatmap-box {
        min-height: 45px !important;
        max-height: 45px !important;
        height: 45px !important;
        font-size: 0.75rem;
    }
    
    .heatmap-day-label {
        font-size: 0.65rem !important;
        padding: 6px 2px !important;
        color: rgb(226, 232, 240) !important; /* Dark theme */
    }
    
    /* Light theme day headers in mobile */
    body.light-ocean .heatmap-day-label,
    body.light-minimal .heatmap-day-label {
        color: rgb(15, 23, 42) !important; /* Almost black */
        font-weight: 800 !important;
    }
    
    .heatmap-grid,
    .heatmap-day-headers {
        gap: 6px;
    }
    
    .heatmap-tooltip {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
    
    /* Mobile navigation buttons - ensure visibility */
    .btn-month-nav,
    #btnPrevMonth,
    #btnNextMonth {
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 6px 10px !important;
        font-size: 1.1rem !important;
        flex-shrink: 0; /* Prevent shrinking */
    }
    
    /* Month selector container - ensure proper spacing */
    .month-selector {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
    }
    
    /* Month title - allow wrapping on very small screens */
    #currentMonth {
        font-size: 0.9rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        text-align: center;
    }
    
    /* CRITICAL: Shrink "Monthly Overview" title text */
    .modal-header h2,
    .monthly-view-header h2,
    h2:has(+ .month-selector),
    .view-header h2 {
        font-size: 1.2rem !important; /* Shrink from default */
        margin: 0.5rem 0 !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .heatmap-box {
        min-height: 38px !important;
        max-height: 38px !important;
        height: 38px !important;
        font-size: 0.7rem;
    }
    
    .heatmap-day-label {
        font-size: 0.6rem !important;
        padding: 4px 2px !important;
        color: rgb(226, 232, 240) !important; /* Dark theme */
    }
    
    /* Light theme day headers in extra small mobile */
    body.light-ocean .heatmap-day-label,
    body.light-minimal .heatmap-day-label {
        color: rgb(15, 23, 42) !important; /* Almost black */
        font-weight: 800 !important;
    }
    
    .heatmap-grid,
    .heatmap-day-headers {
        gap: 4px;
    }
    
    /* Extra small mobile buttons */
    .btn-month-nav,
    #btnPrevMonth,
    #btnNextMonth {
        min-width: 32px !important;
        min-height: 32px !important;
        padding: 4px 8px !important;
        font-size: 1rem !important;
    }
    
    #currentMonth {
        font-size: 0.8rem !important;
    }
    
    /* Even smaller "Monthly Overview" for tiny screens */
    .modal-header h2,
    .monthly-view-header h2,
    h2:has(+ .month-selector),
    .view-header h2 {
        font-size: 1rem !important;
        margin: 0.25rem 0 !important;
    }
}

/* =================================================================
   THEME COMPATIBILITY
   ================================================================= */

/* Light themes - adjust text colors */
body.light-ocean .heatmap-box span,
body.light-minimal .heatmap-box span {
    color: rgb(15, 23, 42);
}

body.light-ocean .heatmap-tooltip,
body.light-minimal .heatmap-tooltip {
    background: rgba(255, 255, 255, 0.98);
    color: rgb(15, 23, 42);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

body.light-ocean .heatmap-tooltip::after,
body.light-minimal .heatmap-tooltip::after {
    border-top-color: rgba(255, 255, 255, 0.98);
}

/* ADHD themes - higher contrast */
body.adhd-mode .heatmap-box:not(.empty):not(.future):hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

body.adhd-mode .heatmap-day-label {
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* =================================================================
   ALIGNMENT VERIFICATION NOTES
   ================================================================= */
/*
 * CRITICAL: Both .heatmap-day-headers and .heatmap-grid MUST have:
 * - Identical grid-template-columns: repeat(7, 1fr)
 * - Identical gap: 8px (or 6px mobile, 4px extra-small)
 * 
 * This ensures perfect vertical alignment between:
 * - Day labels (Sun, Mon, Tue...)
 * - Date cells (1, 2, 3...)
 * 
 * DO NOT modify these values independently!
 */
 /**
 * Settings Modal Theme Fix
 * Ensures text is visible in both light and dark themes
 */

/* =================================================================
   SETTINGS MODAL - TEXT VISIBILITY
   ================================================================= */

/* Settings modal has dark background in both themes, so text needs to be light */
#settingsModal .modal-content h2,
#settingsModal .modal-content h3,
#settingsModal .modal-content p,
#settingsModal .modal-content li,
#settingsModal .modal-content span,
#settingsModal .modal-content label {
    color: rgb(226, 232, 240) !important; /* Light text for dark modal background */
}

/* Settings title - keep existing blue but lighter */
#settingsModal .modal-content h2 {
    color: rgb(56, 189, 248) !important; /* Lighter blue (sky-400) */
}

/* Section headings */
#settingsModal .modal-content h3 {
    color: rgb(226, 232, 240) !important; /* Light slate */
    font-weight: 600;
}

/* Description text */
#settingsModal .modal-content p {
    color: rgb(203, 213, 225) !important; /* Slightly dimmer for hierarchy */
}

/* List items (feature descriptions) */
#settingsModal .modal-content li {
    color: rgb(203, 213, 225) !important;
}

/* Theme dropdown - theme-aware text color */
/* Dark theme: light text */
body.dark #settingsModal select,
body.dark #settingsModal .theme-selector {
    color: rgb(226, 232, 240) !important;
}

/* Light themes: dark text for better readability */
body.light-ocean #settingsModal select,
body.light-serenity #settingsModal select,
body.light-dawn #settingsModal select,
body.light-harmony #settingsModal select,
body.light-mist #settingsModal select {
    color: #0f172a !important; /* Dark text */
    font-weight: 600 !important; /* Bold for visibility */
}

/* Theme hint text - also theme-aware */
body.dark #settingsModal .theme-hint {
    color: rgb(148, 163, 184) !important;
}

body.light-ocean #settingsModal .theme-hint,
body.light-serenity #settingsModal .theme-hint,
body.light-dawn #settingsModal .theme-hint,
body.light-harmony #settingsModal .theme-hint,
body.light-mist #settingsModal .theme-hint {
    color: #64748b !important;
}

/* Button text */
#settingsModal button:not(.btn-close-modal) {
    color: inherit; /* Let button styles handle it */
}

/* Close button - keep existing color */
#settingsModal .btn-close-modal {
    color: rgb(148, 163, 184) !important; /* Medium slate */
}

#settingsModal .btn-close-modal:hover {
    color: rgb(226, 232, 240) !important; /* Lighter on hover */
}

/* =================================================================
   EXCEPTION - MUST BE LAST!
   Export Data section has WHITE background in BOTH themes
   Therefore it ALWAYS needs DARK text
   ================================================================= */

/* Export section container - white background for both themes */
#settingsModal .export-section {
    background: white !important;
    border: 1px solid rgb(226, 232, 240) !important;
    border-radius: 8px !important;
    padding: 1rem !important;
    margin-top: 1rem !important;
}

/* Export section title - DARK TEXT (highest specificity) */
#settingsModal .export-section h3 {
    color: rgb(15, 23, 42) !important; /* Almost black */
    font-weight: 600 !important;
    font-size: 1rem !important;
    margin: 0 0 0.5rem 0 !important;
}

/* Export section description - DARK TEXT */
#settingsModal .export-section p {
    color: rgb(71, 85, 105) !important; /* Dark slate */
    font-size: 0.875rem !important;
    margin: 0 0 1rem 0 !important;
}

/* Checkbox label text */
#settingsModal .export-section label {
    color: rgb(71, 85, 105) !important; /* Medium gray */
    font-size: 0.875rem !important;
}

/* All other text elements in export section */
#settingsModal .export-section span {
    color: rgb(71, 85, 105) !important;
}

/* Export button - keep it green with white text */
#settingsModal .export-section button {
    color: white !important;
    background: rgb(34, 197, 94) !important; /* Green button */
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
}

#settingsModal .export-section button:hover {
    background: rgb(22, 163, 74) !important; /* Darker green on hover */
}

/* =================================================================
   THEME DROPDOWN STYLING
   ================================================================= */

/* Ensure dropdown is readable */
#settingsModal select option {
    background: rgb(30, 41, 59) !important; /* Dark background */
    color: rgb(226, 232, 240) !important; /* Light text */
}

/* =================================================================
   TOGGLE SWITCHES
   ================================================================= */

/* Make sure toggle labels are visible */
#settingsModal .toggle-label,
#settingsModal label[for] {
    color: rgb(226, 232, 240) !important;
}

/* =================================================================
   DIVIDERS
   ================================================================= */

/* Section dividers */
#settingsModal hr,
#settingsModal .divider {
    border-color: rgba(226, 232, 240, 0.1) !important;
}

/* =================================================================
   NOTES
   ================================================================= */
/*
 * Settings modal uses dark background (rgba(0,0,0,0.8)) in BOTH themes
 * Therefore all text must be light colored for visibility
 * 
 * COLOR HIERARCHY:
 * - Headings (h2): rgb(56, 189, 248) - Light blue
 * - Section titles (h3): rgb(226, 232, 240) - Bright slate
 * - Body text (p, li): rgb(203, 213, 225) - Medium-light slate
 * - Muted text: rgb(148, 163, 184) - Dimmer slate
 *//* ===================================================================
   EXPORT SECTION - HOVER FIX
   Add this to the END of phase3-ui.css
   =================================================================== */

/* Override hover background for export checkboxes to keep light background */
#settingsModal .export-section .export-checkbox:hover,
body.dark-ocean #settingsModal .export-section .export-checkbox:hover,
body.light-ocean #settingsModal .export-section .export-checkbox:hover,
body.adhd-blue #settingsModal .export-section .export-checkbox:hover,
body.adhd-green #settingsModal .export-section .export-checkbox:hover,
body.adhd-purple #settingsModal .export-section .export-checkbox:hover,
body.adhd-sunset #settingsModal .export-section .export-checkbox:hover {
    background: rgba(226, 232, 240, 0.5) !important; /* Light gray hover - visible on white */
}

/* Keep text dark even on hover */
#settingsModal .export-section .export-checkbox:hover label,
body.dark-ocean #settingsModal .export-section .export-checkbox:hover label,
body.light-ocean #settingsModal .export-section .export-checkbox:hover label,
body.adhd-blue #settingsModal .export-section .export-checkbox:hover label,
body.adhd-green #settingsModal .export-section .export-checkbox:hover label,
body.adhd-purple #settingsModal .export-section .export-checkbox:hover label,
body.adhd-sunset #settingsModal .export-section .export-checkbox:hover label {
    color: #1e293b !important; /* Keep dark text on hover */
}
