/* Modern Dark Mode with Glass Morphism and Neon Effects */
:root {
    /* Dark Neon Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-primary: #00ffff;
    --neon-secondary: #ff00ff;
    --neon-accent: #ffff00;
    --neon-green: #00ff41;
    --neon-pink: #ff0080;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --shadow-glow: 0 0 20px rgba(0, 255, 255, 0.3);
    --shadow-pink: 0 0 20px rgba(255, 0, 128, 0.3);
    --shadow-green: 0 0 20px rgba(0, 255, 65, 0.3);
}

[data-theme="light"] {
    /* Light mode with subtle neon accents */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --neon-primary: #3b82f6;
    --neon-secondary: #8b5cf6;
    --neon-accent: #f59e0b;
    --neon-green: #10b981;
    --neon-pink: #ec4899;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-glow: 0 4px 20px rgba(59, 130, 246, 0.15);
    --shadow-pink: 0 4px 20px rgba(236, 72, 153, 0.15);
    --shadow-green: 0 4px 20px rgba(16, 185, 129, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Cyberpunk Background */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 128, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 0, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Glass Morphism Header */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Apply futuristic glass to main sections */
.add-habit, .habits-section, .summary {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid transparent;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.add-habit::before, .habits-section::before, .summary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 18px;
    padding: 2px;
    background: linear-gradient(45deg, 
        var(--neon-primary), var(--neon-secondary), 
        var(--neon-accent), var(--neon-pink));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: source-out;
    opacity: 0.6;
    animation: borderGlow 3s linear infinite;
}

.add-habit:hover, .habits-section:hover, .summary:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 40px var(--shadow-glow);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px var(--neon-primary);
    animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    from { 
        filter: brightness(1);
        text-shadow: 0 0 30px var(--neon-primary);
    }
    to { 
        filter: brightness(1.2);
        text-shadow: 0 0 40px var(--neon-primary), 0 0 60px var(--neon-secondary);
    }
}

/* Neon Theme Toggle */
.theme-toggle {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--neon-primary);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, var(--neon-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 40px var(--neon-primary);
}

.theme-toggle:hover::before {
    opacity: 0.2;
}

/* Glass Morphism Main Container */
main {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 2.5rem;
    box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(0, 255, 255, 0.1), transparent 50%);
    pointer-events: none;
}

/* Section Styling */
section {
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 0 10px var(--neon-primary);
}

/* Glass Cards */
.glass-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 18px;
    padding: 2px;
    background: linear-gradient(45deg, 
        var(--neon-primary), var(--neon-secondary), 
        var(--neon-accent), var(--neon-pink));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: source-out;
    opacity: 0.5;
    animation: borderGlow 4s linear infinite;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 50px var(--shadow-glow);
}

.glass-card:hover::before {
    opacity: 0.8;
    filter: brightness(1.3);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-primary), transparent);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    border-color: var(--neon-primary);
}

/* Neon Input Styling */
#habit-input, #category-select, #category-filter {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 15px;
    padding: 15px 20px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

#habit-input::placeholder {
    color: var(--text-muted);
}

#habit-input:focus, #category-select:focus, #category-filter:focus {
    border-color: var(--neon-primary);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.05);
}

/* Neon Buttons */
button {
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    color: var(--text-primary);
    border: none;
    border-radius: 15px;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px var(--neon-primary);
}

button:hover::before {
    left: 100%;
}

/* Futuristic Button Design */
.futuristic-btn {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(0, 20, 40, 0.9) 0%, 
        rgba(0, 30, 60, 0.8) 50%, 
        rgba(0, 40, 80, 0.9) 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px 24px;
    color: #00d4ff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 15px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Animated glowing border */
.futuristic-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    padding: 2px;
    background: linear-gradient(45deg, 
        #00d4ff 0%, 
        #0099cc 25%, 
        #00ffff 50%, 
        #0066ff 75%, 
        #00d4ff 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: source-out;
    animation: borderFlow 2s linear infinite;
    opacity: 0.8;
}

/* Glowing effect overlay */
.futuristic-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.3) 0%, transparent 70%);
    transition: all 0.5s ease;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Hover effects */
.futuristic-btn:hover {
    transform: translateY(-2px);
    color: #ffffff;
    text-shadow: 
        0 0 10px #00d4ff,
        0 0 20px #00d4ff,
        0 0 30px #00d4ff;
    box-shadow: 
        0 8px 25px rgba(0, 212, 255, 0.4),
        0 0 30px rgba(0, 212, 255, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.futuristic-btn:hover::before {
    opacity: 1;
    animation-duration: 1s;
    filter: brightness(1.2);
}

.futuristic-btn:hover::after {
    width: 100%;
    height: 100%;
}

/* Active state */
.futuristic-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 15px rgba(0, 212, 255, 0.3),
        inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Border animation */
@keyframes borderFlow {
    0% { 
        background: linear-gradient(45deg, 
            #00d4ff 0%, #0099cc 25%, #00ffff 50%, #0066ff 75%, #00d4ff 100%);
    }
    25% { 
        background: linear-gradient(45deg, 
            #0066ff 0%, #00d4ff 25%, #0099cc 50%, #00ffff 75%, #0066ff 100%);
    }
    50% { 
        background: linear-gradient(45deg, 
            #00ffff 0%, #0066ff 25%, #00d4ff 50%, #0099cc 75%, #00ffff 100%);
    }
    75% { 
        background: linear-gradient(45deg, 
            #0099cc 0%, #00ffff 25%, #0066ff 50%, #00d4ff 75%, #0099cc 100%);
    }
    100% { 
        background: linear-gradient(45deg, 
            #00d4ff 0%, #0099cc 25%, #00ffff 50%, #0066ff 75%, #00d4ff 100%);
    }
}

/* Size variants */
.futuristic-btn.small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.futuristic-btn.large {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* Icon support */
.futuristic-btn .icon {
    margin-right: 8px;
    filter: drop-shadow(0 0 5px currentColor);
}

/* Add Habit Section */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

#habit-input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--input-bg);
    color: var(--text-color);
}

#habit-input::placeholder {
    color: var(--secondary-text);
}

#habit-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

button {
    padding: 12px 24px;
    background: var(--accent-color);
    color: var(--button-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Habit Items with Neon Effects */
.habit-item {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--neon-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.habit-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.habit-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-glow);
    border-left-color: var(--neon-secondary);
}

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

.habit-item.completed {
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.1), rgba(0, 255, 255, 0.05));
    border-left-color: var(--neon-green);
    box-shadow: var(--shadow-green);
}

.habit-item.completed .habit-text {
    text-decoration: line-through;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

/* Category Badge with Neon Glow */
.category-badge {
    background: linear-gradient(45deg, var(--neon-secondary), var(--neon-pink));
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.4);
    margin-left: 10px;
}

/* Streak Counter with Fire Effect */
.streak-counter {
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 10px;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    animation: fireGlow 2s ease-in-out infinite alternate;
}

@keyframes fireGlow {
    from { box-shadow: 0 0 20px rgba(255, 107, 107, 0.5); }
    to { box-shadow: 0 0 30px rgba(255, 107, 107, 0.8), 0 0 40px rgba(255, 167, 38, 0.4); }
}

.streak-counter.high-streak {
    background: linear-gradient(45deg, var(--neon-green), #44a08d);
    box-shadow: var(--shadow-green);
}

.habit-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.habit-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    transform: scale(1.2);
}

.habit-text {
    font-size: 1.1rem;
    flex: 1;
    color: var(--text-color);
}

.delete-btn {
    background: #dc3545;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.delete-btn:hover {
    background: #c82333;
}

/* Summary Section */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .stat:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-text);
}

.empty-state h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

/* Enhanced completed habit styling for dark mode */
[data-theme="dark"] .habit-item.completed {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border-left-color: #27ae60;
}

[data-theme="dark"] .habit-item.completed .habit-text {
    color: white;
    text-decoration: line-through;
}

/* Better checkbox styling for dark mode */
[data-theme="dark"] .habit-checkbox {
    accent-color: #3498db;
    filter: brightness(1.2);
}

/* Weekly Calendar Styling */
.calendar-section {
    margin-bottom: 2rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

#current-week-range {
    font-weight: bold;
    color: var(--text-color);
    min-width: 200px;
    text-align: center;
}

.weekly-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 1rem;
}

.calendar-day {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.calendar-day.today {
    border-color: var(--accent-color);
    border-width: 3px;
}

.calendar-day.perfect {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-color: #4CAF50;
}

.calendar-day.good {
    background: linear-gradient(135deg, #8BC34A, #7CB342);
    color: white;
    border-color: #8BC34A;
}

.calendar-day.okay {
    background: linear-gradient(135deg, #FFC107, #FFB300);
    color: white;
    border-color: #FFC107;
}

.calendar-day.missed {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border-color: #f44336;
}

.day-name {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.day-number {
    font-size: 1.1rem;
    font-weight: bold;
}

.day-progress {
    font-size: 0.7rem;
    margin-top: 5px;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

.legend-color.perfect { background: #4CAF50; }
.legend-color.good { background: #8BC34A; }
.legend-color.okay { background: #FFC107; }
.legend-color.missed { background: #f44336; }

/* Achievement System with Cyberpunk Styling */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.achievement-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card.unlocked {
    border-color: var(--neon-accent);
    background: linear-gradient(135deg, rgba(255, 255, 0, 0.1), rgba(255, 165, 0, 0.1));
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.4);
    animation: achievementPulse 2s infinite;
}

@keyframes achievementPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 255, 0, 0.4); }
    50% { box-shadow: 0 0 50px rgba(255, 255, 0, 0.7), 0 0 70px rgba(255, 165, 0, 0.3); }
}

.achievement-card.unlocked::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 0, 0.3), transparent);
    animation: achievementShine 3s infinite;
}

@keyframes achievementShine {
    0% { transform: rotate(45deg) translate(-200%, -200%); }
    50% { transform: rotate(45deg) translate(200%, 200%); }
    100% { transform: rotate(45deg) translate(200%, 200%); }
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    filter: drop-shadow(0 0 15px var(--neon-accent));
}

.achievement-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--neon-accent);
    padding: 3rem;
    border-radius: 25px;
    text-align: center;
    max-width: 500px;
    margin: 20px;
    box-shadow: 0 0 50px var(--neon-accent);
    animation: achievementPopup 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes achievementPopup {
    0% { 
        transform: scale(0.3) rotate(-10deg); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.1) rotate(5deg); 
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1; 
    }
}

.achievement-celebration {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: celebrationBounce 1s infinite;
    filter: drop-shadow(0 0 20px var(--neon-accent));
}

@keyframes celebrationBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-20px) scale(1.1); }
    60% { transform: translateY(-10px) scale(1.05); }
}

/* Smart Reminders Styling */
.reminders-section {
    margin-bottom: 2rem;
}

.reminder-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

#enable-notifications, #manage-reminders {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

#enable-notifications:hover, #manage-reminders:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.reminders-panel {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.reminders-panel.hidden {
    display: none;
}

.time-slot {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.time-slot label {
    min-width: 140px;
    color: var(--text-color);
}

.time-slot input[type="time"] {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
}

.time-slot input[type="checkbox"] {
    transform: scale(1.2);
    margin-right: 5px;
}

.smart-suggestions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.suggestion-item {
    background: rgba(103, 126, 234, 0.1);
    border-left: 4px solid var(--accent-color);
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    color: var(--text-color);
}

/* Glowing Analytics Dashboard */
.analytics-section {
    margin-bottom: 3rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-primary), var(--neon-secondary), var(--neon-primary));
    animation: neonFlow 3s linear infinite;
}

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

.metric-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-glow), var(--shadow-pink);
    border-color: var(--neon-primary);
}

.metric-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px var(--neon-primary));
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px var(--neon-primary);
    margin-bottom: 8px;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

/* Glowing Charts Container */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0, 255, 255, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    border-color: var(--neon-primary);
}

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

.chart-card h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 0 10px var(--neon-primary);
}

/* Glowing Chart Canvas */
.chart-card canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 250px;
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.3));
    border-radius: 15px;
}

/* Performance List */
.performance-list {
    max-height: 200px;
    overflow-y: auto;
}

.performance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.performance-item:last-child {
    border-bottom: none;
}

.performance-habit {
    font-weight: 500;
    color: var(--text-color);
}

.performance-bar {
    flex: 1;
    margin: 0 15px;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.performance-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #764ba2);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.performance-percentage {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--accent-color);
    min-width: 40px;
    text-align: right;
}

/* Insights Section */
.insights-section {
    margin-bottom: 2rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.insight-card {
    background: linear-gradient(135deg, rgba(103, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    padding: 15px;
    color: var(--text-color);
}

.insight-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
}

.insight-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--accent-color);
}

.insight-description {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Rankings Section */
.rankings-section {
    margin-bottom: 2rem;
}

.rankings-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--secondary-text);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    font-weight: bold;
}

.tab-btn:hover {
    color: var(--text-color);
}

.rankings-list {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.ranking-item:hover {
    background: rgba(103, 126, 234, 0.05);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-position {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    min-width: 40px;
}

.ranking-medal {
    font-size: 1.2rem;
    margin-right: 10px;
}

.ranking-content {
    flex: 1;
    margin-left: 15px;
}

.ranking-habit {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 3px;
}

.ranking-stats {
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.ranking-score {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: right;
}

/* Persistent Close Button Styling */
.popup-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1002;
    line-height: 1;
    padding: 0;
}

.popup-close-btn:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.1) 100%);
    border-color: var(--neon-primary);
    color: var(--neon-primary);
    transform: scale(1.1);
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.popup-close-btn:active {
    transform: scale(0.95);
}

/* Update awesome button to use class instead of inline onclick */
.popup-awesome-btn {
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.popup-awesome-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 255, 255, 0.5);
    filter: brightness(1.2);
}

.popup-awesome-btn:active {
    transform: translateY(0) scale(0.98);
}

/* General hidden class for popups and modals */
.hidden {
    display: none !important;
}

/* Fade out animation for closing popups */
.achievement-popup.closing {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Ensure popup button is clickable and styled */
.popup-content button {
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.popup-content button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 255, 255, 0.5);
    filter: brightness(1.2);
}

.popup-content button:active {
    transform: translateY(0) scale(0.98);
}

/* Cyberpunk Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    border-radius: 10px;
    box-shadow: 0 0 10px var(--neon-primary);
}

::-webkit-scrollbar-thumb:hover {
    box-shadow: 0 0 20px var(--neon-primary);
}

/* Neon Text Effects */
.neon-text {
    color: var(--neon-primary);
    text-shadow: 
        0 0 5px var(--neon-primary),
        0 0 10px var(--neon-primary),
        0 0 15px var(--neon-primary);
}

/* Loading Animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 255, 0.1);
    border-top: 3px solid var(--neon-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px var(--neon-primary);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Glitch Effect for Special Elements */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch1 2s infinite;
    color: var(--neon-primary);
    z-index: -1;
}

.glitch::after {
    animation: glitch2 2s infinite;
    color: var(--neon-pink);
    z-index: -2;
}

@keyframes glitch1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, 2px); }
    80% { transform: translate(-2px, -2px); }
}

/* Holographic Cards */
.holo-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.holo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(0, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.holo-card:hover::before {
    transform: translateX(100%);
}

/* Particle Background Effect */
@keyframes particles {
    0% { 
        transform: translateY(100vh) rotate(0deg); 
        opacity: 0; 
    }
    10% { 
        opacity: 1; 
    }
    90% { 
        opacity: 1; 
    }
    100% { 
        transform: translateY(-100vh) rotate(360deg); 
        opacity: 0; 
    }
}

.particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--neon-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-primary);
    animation: particles 15s linear infinite;
    z-index: -1;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .metric-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .habit-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    main {
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark/Light Theme Transitions */
* {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Enhanced Futuristic Glassmorphism */
.futuristic-glass {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid transparent;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.futuristic-glass::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 18px;
    padding: 2px;
    background: linear-gradient(45deg, 
        var(--neon-primary), var(--neon-secondary), 
        var(--neon-accent), var(--neon-pink));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    opacity: 0.6;
    animation: borderGlow 3s linear infinite;
}

.futuristic-glass:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 40px var(--shadow-glow);
}

@keyframes borderGlow {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    25% { filter: hue-rotate(90deg) brightness(1.2); }
    50% { filter: hue-rotate(180deg) brightness(1.4); }
    75% { filter: hue-rotate(270deg) brightness(1.2); }
}

/* Special Glow Variants */
.glow-cyan {
    --shadow-glow: 0 0 30px rgba(0, 255, 255, 0.6);
}

.glow-cyan:hover {
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(0, 255, 255, 0.8),
        0 0 100px rgba(0, 255, 255, 0.4);
}

.glow-pink {
    --shadow-glow: 0 0 30px rgba(255, 0, 128, 0.6);
}

.glow-pink:hover {
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(255, 0, 128, 0.8),
        0 0 100px rgba(255, 0, 128, 0.4);
}

.glow-green {
    --shadow-glow: 0 0 30px rgba(0, 255, 65, 0.6);
}

.glow-green:hover {
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(0, 255, 65, 0.8),
        0 0 100px rgba(0, 255, 65, 0.4);
}

.glow-yellow {
    --shadow-glow: 0 0 30px rgba(255, 255, 0, 0.6);
}

.glow-yellow:hover {
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(255, 255, 0, 0.8),
        0 0 100px rgba(255, 255, 0, 0.4);
}

/* Pulse animation for extra emphasis */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 40px rgba(0, 255, 255, 0.8);
    }
}