:root {
    --bg-color: #005941; --card-bg: #ffffff; --text-main: #1a2a3a;
    --text-sub: #7f8c8d; --grid-bg: #f8f9fa; --border-color: #eee;
    --tracker-bg: #eef2f3;
}
[data-theme="dark"] {
    --bg-color: #0a0a0a; --card-bg: #1e1e1e; --text-main: #ffffff;
    --text-sub: #b0bec5; --grid-bg: #2c2c2c; --border-color: #444;
    --tracker-bg: #333;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; margin: 0; background-color: var(--bg-color);
    transition: background-color 0.3s ease;
}
.card {
    background: var(--card-bg); width: 95%; max-width: 550px;
    padding: 1.5rem; border-radius: 24px; text-align: center;
    position: relative; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* UI States */
#session-active-ui { display: block; }
#school-closed-ui { display: none; padding: 40px 20px; }

.glow-pulse {
    color: #c0392b !important;
    font-weight: 900 !important;
    animation: text-glow 1.5s ease-in-out infinite alternate;
}
@keyframes text-glow {
    from { text-shadow: 0 0 2px #fff, 0 0 6px #e74c3c; opacity: 0.8; }
    to { text-shadow: 0 0 4px #fff, 0 0 12px #ff4d4d; opacity: 1; }
}

.theme-switch-wrapper { position: absolute; top: 15px; left: 20px; z-index: 10; }
.theme-switch { display: inline-block; height: 24px; position: relative; width: 44px; }
.theme-switch input { display:none; }
.slider { background-color: #ccc; bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0; transition: .4s; border-radius: 34px; }
.slider:before { background-color: #fff; bottom: 4px; content: ""; height: 16px; left: 4px; position: absolute; transition: .4s; width: 16px; border-radius: 50%; }
input:checked + .slider { background-color: #f1c40f; }
input:checked + .slider:before { transform: translateX(20px); }

.school-logo { height: 60px; width: auto; margin: 0 auto 10px auto; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
h1 { color: var(--text-main); margin: 2px 0; font-size: 1.5rem; text-transform: uppercase; }
.location-sub { color: var(--text-sub); font-weight: 600; font-size: 0.85rem; margin-bottom: 10px; }

#noaa-warning { display: none; background-color: #d32f2f; color: white; padding: 10px; font-weight: bold; border-radius: 12px; margin-bottom: 10px; font-size: 0.85rem; animation: pulse-border 1.5s infinite; }
@keyframes pulse-border { 0% { box-shadow: 0 0 0 0px rgba(211, 47, 47, 0.7); } 100% { box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); } }

#caution-banner { display: none; background-color: #f39c12; color: white; padding: 10px; font-weight: bold; border-radius: 10px; margin-bottom: 10px; font-size: 0.75rem; }

.banner { font-size: 1.4rem; font-weight: 900; padding: 18px; margin: 10px 0; border-radius: 15px; text-transform: uppercase; }
.go-outside { background-color: #27ae60; color: white; }
.indoor-recess { background-color: #c0392b; color: white; }
.loading-banner { background-color: #bdc3c7; color: white; }

.live-tracker { background: var(--tracker-bg); border-radius: 15px; padding: 12px; margin: 10px 0; display: flex; justify-content: space-around; border-left: 5px solid #005941; color: var(--text-main); }
.tracker-item { flex: 1; }
.tracker-label { font-size: 0.65rem; color: var(--text-sub); text-transform: uppercase; font-weight: bold; }
.tracker-value { font-size: 1rem; font-weight: bold; }

.weather-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--grid-bg); padding: 12px; border-radius: 15px; margin-bottom: 15px; }
.stat-label { font-size: 0.55rem; color: var(--text-sub); text-transform: uppercase; font-weight: bold; }
.stat-value { font-weight: bold; font-size: 1rem; color: var(--text-main); }

.schedule-box { margin-top: 15px; padding-top: 10px; border-top: 2px solid var(--border-color); }
.schedule-title { font-size: 0.9rem; color: #005941; font-weight: 800; margin-bottom: 12px; text-transform: uppercase; }
[data-theme="dark"] .schedule-title { color: #2ecc71; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { color: var(--text-sub); font-size: 0.7rem; padding-bottom: 8px; text-transform: uppercase; }
td { padding: 8px 0; border-bottom: 1px solid var(--border-color); font-weight: 600; color: var(--text-main); }
.grade-col { text-align: left; color: #005941; width: 35%; }
[data-theme="dark"] .grade-col { color: #2ecc71; }

.refresh-btn { background: #005941; color: white; border: none; padding: 10px 20px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; cursor: pointer; margin-top: 10px; }

.closed-title { color: var(--bg-color); font-size: 1.3rem; margin-bottom: 10px; }
[data-theme="dark"] .closed-title { color: #2ecc71; }
.countdown-text { display: none; }

.credits { font-size: 0.65rem; color: var(--text-sub); margin-top: 20px; font-style: italic; line-height: 1.4; }
.disclaimer { font-size: 0.75rem; color: var(--text-sub); margin-top: 12px; line-height: 1.4; opacity: 0.9; padding: 0 10px; }

#timestamp { font-size: 0.7rem; color: #005941; font-weight: bold; margin-top: 5px; }
#progress-container { position: absolute; bottom: 0; left: 0; width: 100%; height: 5px; background: #eee; }
#progress-bar { width: 0%; height: 100%; background: #f39c12; }

/* Sleeping Icon Animation */
.sleeping-icon {
    font-size: 5rem;
    margin-bottom: 0px;
    display: inline-block;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    animation: sleep-breathe 3s ease-in-out infinite;
}
@keyframes sleep-breathe {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* --- NEW: Weather Emoji Animations --- */
.weather-emoji { display: inline-block; margin-right: 4px; }

/* Fast side-to-side shaking for cold */
.anim-shiver { animation: shiver 0.2s linear infinite alternate; }
@keyframes shiver { from { transform: translateX(-1px) rotate(-2deg); } to { transform: translateX(1px) rotate(2deg); } }

/* Slow pulsing drop for hot */
.anim-sweat { animation: sweat 1.5s ease-in-out infinite alternate; }
@keyframes sweat { from { transform: scale(1); opacity: 1; } to { transform: scale(1.15); opacity: 0.8; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2)); } }

/* Gentle breathing for pleasant weather */
.anim-nice { animation: nice-pulse 3s ease-in-out infinite alternate; }
@keyframes nice-pulse { from { transform: scale(1); } to { transform: scale(1.08); } }