/* Reset & Base Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Christmas Color Palette */
    --christmas-red: #c62828;
    --christmas-green: #2e7d32;
    --christmas-gold: #ffb300;
    --christmas-blue: #1565c0;
    --snow-white: #f8f9fa;
    --warm-dark: #1a1a2e;
    --soft-red: #e57373;
    --soft-green: #81c784;
    --soft-gold: #ffd54f;
    /* Theme Variables */
    --bg-primary: #f0f7ff;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --border-radius: 20px;
    --transition: all 0.3s ease;
}


/* Night Mode */

.night-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --panel-bg: rgba(30, 41, 59, 0.9);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #e3f2fd 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: var(--transition);
}

.night-mode body {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0c4a6e 100%);
}


/* Snow Animation */

#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.snowflake {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}


/* Night Mode Toggle */

.night-mode-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--christmas-gold);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.night-mode-btn:hover {
    transform: rotate(30deg);
    background: var(--christmas-red);
}

.night-mode-btn .fa-sun {
    display: none;
}

.night-mode .night-mode-btn .fa-moon {
    display: none;
}

.night-mode .night-mode-btn .fa-sun {
    display: block;
}


/* Container */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}


/* Header */

.header {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border: 2px solid var(--christmas-green);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--christmas-red), var(--christmas-gold), var(--christmas-green));
}

.logo h1 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.5rem;
    color: var(--christmas-red);
    margin-bottom: 5px;
}

.christmas-icon {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.streak-display {
    background: var(--christmas-red);
    color: white;
    padding: 8px 15px;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.streak-icon {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.snow-toggle {
    background: var(--christmas-blue);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.snow-toggle:hover {
    background: var(--christmas-green);
    transform: translateY(-2px);
}


/* Dashboard */

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    border: 2px solid;
    transition: var(--transition);
}

.sleep-panel {
    border-color: var(--christmas-blue);
}

.anxiety-panel {
    border-color: var(--christmas-green);
}

.festive-panel {
    border-color: var(--christmas-gold);
}

.panel h2 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 15px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* Buttons */

.btn-primary,
.btn-secondary,
.panic-btn,
.not-okay-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--christmas-red), var(--soft-red));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(198, 40, 40, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--christmas-green);
}

.btn-secondary:hover {
    background: var(--christmas-green);
    color: white;
    transform: translateY(-2px);
}

.panic-btn {
    background: linear-gradient(135deg, #ff6b6b, #c62828);
    color: white;
    margin-bottom: 10px;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

.not-okay-btn {
    background: linear-gradient(135deg, #4fc3f7, #1565c0);
    color: white;
}


/* Audio Player */

.audio-controls {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    margin: 15px 0;
}

.audio-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.audio-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--christmas-blue);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.audio-btn:hover {
    background: var(--christmas-green);
    transform: scale(1.1);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

#volumeSlider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--christmas-green), var(--christmas-gold));
    outline: none;
}


/* Breathing Exercise */

.breathing-circle {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--christmas-green), var(--christmas-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breathe 8s infinite ease-in-out;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

@keyframes breathe {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}


/* Mood Tracker */

.mood-options {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
}

.mood-option {
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: var(--transition);
}

.mood-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.mood-option span {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}


/* Badges */

.badges-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.badge {
    background: linear-gradient(135deg, var(--christmas-gold), #ff9800);
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    color: white;
    transition: var(--transition);
}

.badge:hover {
    transform: translateY(-5px) rotate(5deg);
}

.badge span {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}


/* AI Support */

.ai-input textarea {
    width: 100%;
    height: 80px;
    padding: 15px;
    border-radius: 15px;
    border: 2px solid var(--christmas-green);
    background: var(--bg-secondary);
    color: var(--text-primary);
    resize: none;
    margin: 10px 0;
}

.ai-response-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    margin-top: 15px;
    border-left: 4px solid var(--christmas-red);
}


/* Footer */

.footer {
    text-align: center;
    padding: 20px;
    background: var(--panel-bg);
    border-radius: var(--border-radius);
    margin-top: 30px;
    border-top: 3px solid var(--christmas-red);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
}

.footer-links a {
    color: var(--christmas-blue);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--christmas-red);
    transform: translateY(-2px);
}


/* Hidden Class */

.hidden {
    display: none !important;
}


/* Responsive Design */

@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .logo h1 {
        font-size: 2rem;
    }
    .panel {
        padding: 20px;
    }
}


/* Festive Animations */

@keyframes twinkle {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.festive-panel h2 {
    animation: twinkle 2s infinite;
}


/* Progress Elements */

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--christmas-green) 75%, #e0e0e0 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    background: var(--panel-bg);
    border-radius: 50%;
}

.score-circle span {
    font-size: 2rem;
    font-weight: bold;
    color: var(--christmas-green);
    z-index: 1;
}


/* Stars for Sleep Rating */

.stars {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    font-size: 2rem;
    color: var(--christmas-gold);
    cursor: pointer;
}

.stars i:hover {
    transform: scale(1.2);
}


/* Message & Quote Boxes */

.message-box,
.quote-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 15px 0;
    border-left: 4px solid var(--christmas-gold);
    font-style: italic;
}


/* Select Elements */

select,
input[type="time"] {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--christmas-green);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    margin: 10px 0;
}


/* Quiz Styles */

.quiz-question {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
}

.quiz-option {
    display: block;
    padding: 10px;
    margin: 5px 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.quiz-option:hover {
    background: var(--christmas-green);
    color: white;
}


/* Grounding Exercise */

#groundingSteps {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-top: 15px;
}

.grounding-step {
    padding: 10px;
    margin: 10px 0;
    border-left: 4px solid var(--christmas-blue);
    background: rgba(255, 255, 255, 0.05);
}