/* ===================================
   LIGHT WEATHER THEME - Cream/Warm Palette
   Fonts: DM Serif Display (headings), Source Sans 3 (body)
   =================================== */

/* Map + Estat de les escoles Hero Group */
.map-hero-group {
    margin: 0 auto 40px auto;
    max-width: 1400px;
    padding: 0 32px;
    width: 100%;
}

@media (max-width: 1200px) {
    .map-hero-group {
        max-width: 1000px;
        padding: 0 24px;
    }
}

@media (max-width: 768px) {
    .map-hero-group {
        max-width: 100%;
        padding: 0 16px;
    }
}

.map-hero-rectangle {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.map-wrapper {
    width: 100%;
    box-sizing: border-box;
    background: var(--cream) !important;
}

#catalonia-map {
    background: var(--cream) !important;
}

#catalunya-svg-container {
    background: var(--cream) !important;
}

.school-list-panel {
    background: var(--bg-secondary);
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid var(--border-color);
}

#school-list-header {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1em;
    padding: 16px 20px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--transition);
}

#school-list-header:hover {
    background: var(--bg-card-hover);
}

#school-list-toggle {
    font-size: 1.2em;
    transition: transform 0.2s;
    color: var(--text-secondary);
}

#school-list {
    list-style: none;
    padding: 0 20px 16px 20px;
    margin: 0;
    display: block;
}

#school-list li {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-primary);
}

#school-list .school-name {
    font-weight: 600;
    color: var(--text-primary);
}

#school-list .school-status-value {
    color: var(--text-secondary);
}

@media (max-width: 600px) {
    .map-hero-group {
        padding: 0 8px;
    }
    #school-list-header {
        padding: 14px 16px;
    }
    #school-list {
        padding: 0 16px 14px 16px;
    }
}
/* ===================================
   METEO:BIT - MODERN WEATHER DASHBOARD
   Trendy Educational Design 2025
   With Light/Dark Mode Support
   =================================== */

/* CSS Variables - Light Weather Theme */
:root {
    /* Primary Colors - Sky and weather themed */
    --sky-light: #E8F4FD;
    --sky-primary: #4A90D9;
    --sky-deep: #2563EB;
    --sky-dark: #1E40AF;
    
    /* Accent Colors - Weather themed */
    --sun: #F59E0B;
    --sunrise: #FB923C;
    --sunset: #EA580C;
    --rain: #3B82F6;
    --cloud: #94A3B8;
    --wind: #06B6D4;
    
    /* Warm Cream/Beige Palette */
    --cream: #FAF8F5;
    --cream-dark: #F5F0E8;
    --warm-white: #FFFDF9;
    --sand: #E8E4DC;
    --stone: #D4CFC5;
    
    /* Neutrals - Warm tones */
    --white: #FFFFFF;
    --gray-50: #FAFAF9;
    --gray-100: #F5F5F4;
    --gray-200: #E7E5E4;
    --gray-300: #D6D3D1;
    --gray-400: #A8A29E;
    --gray-500: #78716C;
    --gray-600: #57534E;
    --gray-700: #44403C;
    --gray-800: #292524;
    --gray-900: #1C1917;
    
    /* Gradients - Soft weather */
    --gradient-sky: linear-gradient(135deg, #E8F4FD 0%, #BFDBFE 100%);
    --gradient-sunset: linear-gradient(135deg, #FED7AA 0%, #FECACA 100%);
    --gradient-ocean: linear-gradient(135deg, #CFFAFE 0%, #A5F3FC 100%);
    --gradient-forest: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    --gradient-aurora: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
    --gradient-warm: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    
    /* Shadows - Softer for light theme */
    --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow: 0 2px 8px rgba(28, 25, 23, 0.06);
    --shadow-md: 0 4px 16px rgba(28, 25, 23, 0.08);
    --shadow-lg: 0 8px 32px rgba(28, 25, 23, 0.10);
    --shadow-xl: 0 16px 48px rgba(28, 25, 23, 0.12);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Typography - New fonts */
    --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;
    
    /* Theme colors - Light cream mode */
    --bg-primary: var(--cream);
    --bg-secondary: var(--warm-white);
    --bg-tertiary: var(--cream-dark);
    --bg-card: var(--white);
    --bg-card-hover: var(--gray-50);
    --border-color: rgba(28, 25, 23, 0.08);
    --border-color-hover: rgba(28, 25, 23, 0.15);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-700);
    --text-tertiary: var(--gray-500);
    --text-muted: var(--gray-400);
    --header-bg: rgba(255, 253, 249, 0.9);
    --map-fill: rgba(59, 130, 246, 0.08);
    --map-stroke: rgba(59, 130, 246, 0.3);
    --comarca-stroke: rgba(59, 130, 246, 0.15);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--cream);
    color-scheme: light;
}

body {
    font-family: var(--font-sans);
    background: var(--cream);
    background-color: var(--cream);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

/* Animated Background - Soft gradient */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 50%, var(--sand) 100%);
    overflow: hidden;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(74, 144, 217, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 50%);
    animation: aurora 30s ease-in-out infinite;
}

@keyframes aurora {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(5%, 10%) rotate(5deg); }
    66% { transform: translate(-5%, 5%) rotate(-5deg); }
}

/* Floating Clouds - Light theme */
.clouds {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.5;
}

.cloud:nth-child(1) {
    width: 400px;
    height: 200px;
    top: 10%;
    left: -200px;
    animation: float1 35s ease-in-out infinite;
}

.cloud:nth-child(2) {
    width: 300px;
    height: 150px;
    top: 40%;
    left: -150px;
    animation: float2 40s ease-in-out infinite;
    animation-delay: 5s;
}

.cloud:nth-child(3) {
    width: 350px;
    height: 175px;
    top: 70%;
    left: -175px;
    animation: float3 45s ease-in-out infinite;
    animation-delay: 10s;
}

@keyframes float1 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(calc(100vw + 200px)); }
}

@keyframes float2 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(calc(100vw + 150px)); }
}

@keyframes float3 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(calc(100vw + 175px)); }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header - Glass-morphism effect */
.header {
    background: var(--header-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo - Modern & Bold */
.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    transition: transform var(--transition);
}

.logo:hover {
    transform: translateY(-2px);
}

.logo-icon {
    font-size: 2.5rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.logo-text span {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Navigation - Sleek & Modern */
.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-full);
    transition: all var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.nav-dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-dropdown-item .school-icon {
    margin-right: 8px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    padding: 10px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--bg-card-hover);
}

/* Hero Section - Bold & Engaging */
.hero {
    padding: 100px 0 80px;
    text-align: center;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(74, 144, 217, 0.1);
    border: 1px solid rgba(74, 144, 217, 0.2);
    border-radius: var(--radius-full);
    color: var(--sky-deep);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 32px;
    animation: float-up 1s ease-out;
}

.hero-badge span:first-child {
    font-size: 1.25rem;
}

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

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 24px;
    animation: float-up 1s ease-out 0.2s backwards;
}

.hero p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 48px;
    animation: float-up 1s ease-out 0.4s backwards;
}

.hero p strong {
    color: var(--sun);
    font-weight: 700;
}

/* Hero Stats - Eye-catching metrics */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
    animation: float-up 1s ease-out 0.6s backwards;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 400;
    line-height: 1;
    color: var(--sky-deep);
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

/* Sections */
.schools-section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.section-title p {
    font-size: 1.15rem;
    color: var(--text-tertiary);
    max-width: 600px;
    margin: 0 auto;
}

/* Schools Grid - Masonry-like layout */
.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 32px;
}

/* School Cards - Light theme with shadows */
.school-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.school-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-lg);
}

.school-card-header {
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.school-card-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    filter: brightness(0.9);
}

.school-icon {
    position: relative;
    z-index: 1;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(255, 255, 255, 0.1);
    transition: transform var(--transition-bounce);
}

.school-card:hover .school-icon {
    transform: scale(1.1) rotate(5deg);
}

.school-card-body {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.school-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.school-card h3:hover {
    color: var(--sky-deep);
}

.school-card p {
    color: var(--text-tertiary);
    font-size: 1rem;
    margin-bottom: 24px;
    flex: 1;
    line-height: 1.6;
}

.school-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.school-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22C55E;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--gray-400);
    box-shadow: none;
    animation: none;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.view-data-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--sky-deep);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition);
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.view-data-btn:hover {
    background: var(--sky-dark);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* School color themes */
.school-card[data-school="1"] .school-card-header {
    background: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
}
.school-card[data-school="2"] .school-card-header {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}
.school-card[data-school="3"] .school-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.school-card[data-school="4"] .school-card-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.school-card[data-school="5"] .school-card-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.school-card[data-school="6"] .school-card-header {
    background: linear-gradient(135deg, #FA709A 0%, #FEE140 100%);
}

/* Dashboard Specific */
.dashboard {
    padding: 40px 0 80px;
    min-height: 100vh;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 32px;
    padding: 10px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    transition: all var(--transition);
    border: 1px solid var(--border-color);
}

.back-link:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    transform: translateX(-4px);
}

.dashboard-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.school-badge {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: var(--shadow-md);
}

.dashboard-title h1 {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.dashboard-title h1 span {
    display: block;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* Date Controls */
.date-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.date-input-group input {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    transition: all var(--transition);
}

.date-input-group input:focus {
    outline: none;
    border-color: var(--sky-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--sky-deep);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--sky-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

/* Quick Date Buttons */
.quick-dates {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.quick-date-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

.quick-date-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
}

.quick-date-btn.active {
    background: var(--sky-deep);
    border-color: transparent;
    color: var(--white);
}

/* Weather Cards - Dashboard */
.current-weather {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.weather-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.weather-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.weather-card-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.weather-card-icon.temp {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.weather-card-icon.humidity {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.weather-card-icon.pressure {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.weather-card-icon.wind {
    background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.weather-card-content h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.weather-card-value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.weather-card-value small {
    font-size: 1rem;
    opacity: 0.6;
    margin-left: 4px;
}

/* ===================================
   WEATHER SUMMARY HERO
   =================================== */

.weather-summary-hero {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.summary-main {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 32px;
    margin-bottom: 32px;
}

.summary-temp-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.summary-temp-display {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

.temp-value {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 400;
    line-height: 1;
    color: var(--text-primary);
}

.temp-unit {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-top: 12px;
    margin-left: 4px;
}

.summary-condition {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.condition-icon {
    font-size: 2rem;
}

.condition-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-location {
    font-size: 1rem;
    color: var(--text-tertiary);
}

.summary-chart-section {
    display: flex;
    flex-direction: column;
}

.summary-chart-section h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
}

.mini-chart-container {
    flex: 1;
    min-height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 16px;
}

.summary-indicators {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.indicator-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: all var(--transition);
}

.indicator-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
}

.indicator-gauge {
    position: relative;
    width: 100%;
    max-width: 120px;
    margin: 0 auto 12px;
}

.gauge-svg {
    width: 100%;
    height: auto;
    display: block;
}

.gauge-value {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
}

.indicator-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.95rem;
}

.indicator-icon {
    font-size: 1.25rem;
}

/* Responsive for summary hero */
@media (max-width: 900px) {
    .summary-main {
        grid-template-columns: 1fr;
    }
    
    .summary-temp-section {
        align-items: center;
        text-align: center;
    }
    
    .temp-value {
        font-size: 4.5rem;
    }
    
    .mini-chart-container {
        min-height: 120px;
    }
}

@media (max-width: 600px) {
    .summary-indicators {
        grid-template-columns: 1fr;
    }
    
    .temp-value {
        font-size: 3.5rem;
    }
    
    .temp-unit {
        font-size: 1.5rem;
    }
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 32px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    padding: 32px;
    transition: all var(--transition);
}

.chart-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.chart-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.chart-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* Last Update */
.last-update {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.update-time {
    font-family: var(--font-mono);
    color: var(--white);
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--sky-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Error State */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: #FCA5A5;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0;
}

.error-message span:first-child {
    font-size: 2rem;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 80px 20px;
}

.no-data-icon {
    font-size: 5rem;
    margin-bottom: 24px;
    opacity: 0.5;
}

.no-data h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.no-data p {
    color: var(--text-tertiary);
    font-size: 1.1rem;
}

/* ===================================
   CATALONIA MAP COMPONENT
   =================================== */

.catalonia-map-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow);
}

.map-header {
    text-align: center;
    margin-bottom: 24px;
}

.map-header h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.map-header p {
    color: var(--text-tertiary);
    font-size: 1rem;
}

.sensor-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.sensor-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

.sensor-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
}

.sensor-btn.active {
    background: var(--sky-deep);
    border-color: transparent;
    color: var(--white);
}

.sensor-btn span:first-child {
    font-size: 1.25rem;
}

.map-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 700px;
    overflow: visible;
    padding-bottom: 60px;
}

#catalonia-svg {
    width: 100%;
    max-width: 550px;
    height: auto;
    background: var(--cream) !important;
}

/* Catalunya map styling */
.comarca-path {
    fill: var(--cream) !important;
    stroke: var(--border-color) !important;
    transition: all 0.3s ease !important;
}

.comarca-path:hover {
    fill: var(--sand) !important;
}

#catalunya-svg-container svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
    background: var(--cream) !important;
}

/* Catalunya comarca labels - black text */
.comarca-text, text {
    fill: var(--gray-900) !important;
}

/* Map zoom controls */
.map-zoom-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.map-zoom-controls button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.map-zoom-controls button:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
    transform: scale(1.05);
}

.sea-label {
    fill: var(--text-tertiary);
    transition: fill var(--transition);
}

.marker-label {
    fill: var(--gray-900);
    font-weight: 600;
    transition: fill var(--transition);
}



.map-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 16px;
    min-width: 150px;
    box-shadow: var(--shadow);
}

.legend-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legend-gradient {
    height: 10px;
    border-radius: 5px;
    margin-bottom: 6px;
    background: linear-gradient(to right, #3B82F6, #10B981, #FBBF24, #F97316, #EF4444);
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.map-info {
    margin-top: 24px;
    text-align: center;
    min-height: 50px;
    transition: all 0.3s ease;
}

.map-info:has(.school-info-card) {
    min-height: 280px;
}

.map-info > p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.school-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
    box-shadow: var(--shadow);
}

.school-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.school-info-header .school-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    background: var(--bg-card-hover);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.school-info-header h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0;
}

.school-info-header p {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin: 4px 0 0 0;
}

.school-info-values {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.info-value {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px;
    background: var(--bg-card-hover);
    border-radius: var(--radius-sm);
    min-width: 0;
    overflow: hidden;
}

.info-value span:first-child {
    font-size: 1.1rem;
}

.info-value span:nth-child(2) {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    word-break: break-word;
}

.info-value .info-ts {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-sans);
    font-weight: 400;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 48px 0;
    margin-top: 80px;
}

.footer img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   DEMO MODE TOGGLE
   =================================== */

.demo-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.demo-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.demo-toggle.active {
    background: #059669;
    border-color: transparent;
    color: var(--white);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}

.demo-toggle-icon {
    font-size: 1.25rem;
}

.demo-toggle-text {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .schools-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px;
        gap: 12px;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all var(--transition);
        border-top: 1px solid var(--border-color);
    }
    
    .nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    
    .nav-link {
        padding: 14px 20px;
        border-radius: var(--radius);
    }
    
    .hero {
        padding: 60px 0 40px;
    }
    
    .hero-stats {
        gap: 32px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .dashboard-header {
        padding: 24px;
    }
    
    .dashboard-title {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-title h1 {
        font-size: 1.75rem;
    }
    
    .date-controls {
        flex-direction: column;
    }
    
    .current-weather {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .schools-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations & Micro-interactions */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.shimmer {
    animation: shimmer 2s infinite;
    background: linear-gradient(
        to right,
        var(--bg-card) 0%,
        var(--bg-card-hover) 20%,
        var(--bg-card) 40%,
        var(--bg-card) 100%
    );
    background-size: 1000px 100%;
}

@media (max-width: 600px) {
    .demo-toggle {
        bottom: 16px;
        left: 16px;
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .demo-toggle-text {
        display: none;
    }
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--sky-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .header, .footer, .back-link, .date-controls, .quick-dates {
        display: none;
    }
    
    .animated-bg, .clouds {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
