/* =====================================================
   SCOOTERCAM STYLE.CSS
   Enhanced typography & refined color palette
   ===================================================== */

/* =====================================================
   CUSTOM FONTS
   ===================================================== */

/* Cherry Cream Soda - Display font for headers */
@font-face {
    font-family: 'Cherry Cream Soda';
    src: url('fonts/cherry-cream-soda.woff2') format('woff2'),
         url('fonts/cherry-cream-soda.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Shows fallback immediately, swaps when loaded */
}

/* =====================================================
   CSS CUSTOM PROPERTIES (Brand Colors)
   ===================================================== */

:root {
    /* Brand Colors */
    --color-primary: #164866;      /* Dark blue - primary brand */
    --color-secondary: #38b6ff;    /* Sky blue - secondary brand */
    --color-accent: #f3b02e;       /* Gold/orange - accent */
    --color-alert: #df4a2a;        /* Red/coral - alerts/warnings */
    
    /* Functional Colors */
    --color-text-primary: #333;
    --color-text-secondary: #666;
    --color-text-light: #888;
    --color-bg-main: #f5f5f5;
    --color-bg-card: #ffffff;
    --color-bg-alternate: #f8f9fa;
    --color-border: #dee2e6;
    
    /* Temperature Trend Colors (derived from brand) */
    --color-temp-rising: #df4a2a;  /* Alert red */
    --color-temp-falling: #38b6ff; /* Sky blue */
    --color-temp-steady: #666;     /* Neutral gray */
    
    /* Typography */
    --font-display: 'Cherry Cream Soda', cursive;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    --font-data: var(--font-body); /* Same font, but with tabular nums */
}

/* =====================================================
   BASE STYLES
   ===================================================== */

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

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text-primary);
    background: var(--color-bg-main);
}

/* Headers use display font */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: normal;
}

/* Data displays use tabular numerals for alignment */
.temp-display,
.condition-item .value,
.forecast-table td,
.temp-widget-main,
.temp-widget-change {
    font-family: var(--font-data);
    font-variant-numeric: tabular-nums;
}

/* Verbose text (alerts, forecasts) uses body font */
.alert-content,
.forecast-text,
.forecast-period,
.forecast-card {
    font-family: var(--font-body);
    line-height: 1.7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================================================
   HEADER
   ===================================================== */

.site-header {
    background: linear-gradient(
        to bottom, 
        var(--color-secondary) 0%, 
        var(--color-secondary) 35%, 
        var(--color-accent) 65%, 
        var(--color-accent) 100%
    );
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Header Top Row - 3 Column Grid */
.header-top {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

/* Column 1: Logo */
.header-logo a {
    display: block;
    line-height: 0;
}

.site-logo {
    width: 100px;
    height: 100px;
    display: block;
    transition: opacity 0.3s;
}

.site-logo:hover {
    opacity: 0.9;
}

/* Column 2: Title & Tagline */
.header-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-title .title-link {
    text-decoration: none;
    color: white;
    transition: opacity 0.3s;
}

.header-title .title-link:hover {
    opacity: 0.9;
}

.header-title .site-title {
    display: block;
    font-family: var(--font-display);  /* Add this line */
    font-size: 2.5rem;
    margin: 0;
    line-height: 1.2;
    /* Stronger shadow for better contrast on gradient */
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5),
                 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.header-title .tagline {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 400; /* Changed from 300 for better visibility */
    opacity: 1; /* Changed from 0.95 - no opacity reduction */
    margin: 0.25rem 0 0 0;
    /* Stronger shadow for better contrast */
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5),
                 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.header-title .tagline-secondary {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600; /* Bolder for better contrast on gradient */
    color: var(--color-primary); /* #164866 */
    margin: 0.25rem 0 0 0;
    opacity: 1;
    /* Adding shadow for better visibility on gold gradient */
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

/* Column 3: Hamburger Toggle */
.header-toggle {
    display: none; /* Hidden on desktop */
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Menu Toggle Active State */
.menu-toggle[aria-expanded="true"] .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle[aria-expanded="true"] .hamburger:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Header Nav Row (Desktop) */
.header-nav {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    list-style: none;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
    white-space: nowrap;
}

.main-nav a:hover {
    background: rgba(255,255,255,0.2);
}

/* Remove any separator between nav items */
.main-nav a::before {
    content: none;
}

/* =====================================================
   TEMPERATURE WIDGET
   ===================================================== */

.temp-widget {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.temp-widget-main {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
    color: var(--color-primary);
    line-height: 1;
}

.temp-widget-trend {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.temp-widget-change {
    font-size: 1rem;
    color: var(--color-text-light);
    font-weight: normal;
}

/* Trend-specific styling */
.temp-widget-rising .temp-widget-trend {
    color: var(--color-temp-rising);
}

.temp-widget-falling .temp-widget-trend {
    color: var(--color-temp-falling);
}

.temp-widget-steady .temp-widget-trend {
    color: var(--color-temp-steady);
}

.temp-widget.unavailable {
    opacity: 0.6;
    font-style: italic;
}

/* =====================================================
   ALERTS
   ===================================================== */

.alerts-section {
    margin: 2rem 0;
}

.alert {
    background: var(--color-bg-card);
    border-left: 4px solid var(--color-accent);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-severe {
    border-left-color: var(--color-alert);
    background: #fff5f5;
}

.alert-high {
    border-left-color: var(--color-accent);
    background: #fff8f3;
}

.alert-emoji {
    font-size: 2rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    color: var(--color-alert);
}

/* =====================================================
   HERO & CAMERA SECTIONS
   ===================================================== */

.hero-section {
    background: var(--color-bg-card);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.camera-section,
.cameras-section {
    background: var(--color-bg-card);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.camera-view {
    margin-bottom: 2rem;
}

.camera-view:last-child {
    margin-bottom: 0;
}

.hero-section h2,
.camera-section h2,
.cameras-section h2,
.camera-view h3 {
    margin-bottom: 1rem;
    color: var(--color-primary);
    font-size: 1.5rem;
}

.camera-view h3 {
    margin-bottom: 1rem;
    color: var(--color-primary);
    font-size: 1.5rem;
}

/* Alternative: Camera label as paragraph (for accessibility Option 2) */
.camera-label {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: normal;
    color: var(--color-primary);
    margin: 0 0 1rem 0;
}

.hero-link {
    display: block;
    text-decoration: none;
    transition: opacity 0.3s;
}

.hero-link:hover {
    opacity: 0.9;
}

.hero-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hero-link:hover .hero-container {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.hero-image,
.camera-image {
    width: 100%;
    height: auto;
    display: block;
}

/* =====================================================
   CURRENT CONDITIONS
   ===================================================== */

.current-section {
    background: var(--color-bg-card);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.current-section h2 {
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

.conditions-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.conditions-main {
    text-align: center;
    padding: 1.5rem;
    background: var(--color-bg-card);  /* White background */
    color: var(--color-primary);  /* #164866 dark blue text */
    border-radius: 6px;  /* Match condition-item */
    border-left: 3px solid var(--color-primary);  /* Left accent border */
}

.temp-display {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.25rem;
    color: var(--color-primary);  /* Match parent */
}

.temp-display .temp {
    font-size: 4rem;
    font-weight: bold;
    line-height: 1;
}

.temp-display .unit {
    font-size: 1.5rem;
    margin-top: 0.5rem;
}

.feels-like {
    font-size: 1.1rem;
    color: var(--color-text-secondary);  /* Changed from white with opacity */
    margin-top: 0.5rem;
}

/* Temperature Trend in Current Conditions */
.temp-trend-display {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);  /* Changed from white/transparent */
}

.temp-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--color-text-primary);  /* Changed from white */
}

.temp-trend .trend-emoji {
    font-size: 1.5rem;
}

.temp-trend .trend-text {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.temp-trend .trend-change {
    font-weight: bold;
    font-size: 1.1rem;
}

.temp-trend .trend-timeframe {
    font-size: 0.85rem;
    color: var(--color-text-light);  /* Changed from transparent white */
    margin-left: auto;
}

/* Trend colors - now work on white background */
.temp-trend-rising .trend-change {
    color: var(--color-temp-rising);  /* #df4a2a - red */
}

.temp-trend-falling .trend-change {
    color: var(--color-temp-falling);  /* #38b6ff - sky blue */
}

.temp-trend-steady .trend-text {
    color: var(--color-temp-steady);  /* #666 - gray */
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.condition-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg-alternate);
    border-radius: 6px;
    border-left: 3px solid var(--color-primary);
}

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

.condition-item .details {
    display: flex;
    flex-direction: column;
}

.condition-item .label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.condition-item .value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--color-text-primary);
}

.conditions-updated {
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.9rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* =====================================================
   FORECAST SECTIONS
   ===================================================== */

.forecast-section {
    background: var(--color-bg-card);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.forecast-section h2 {
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.forecast-text {
    line-height: 1.8;
}

.forecast-periods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.forecast-period {
    padding: 1rem;
    background: var(--color-bg-alternate);
    border-left: 4px solid var(--color-primary);
    border-radius: 4px;
}

.forecast-period h3 {
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

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

.forecast-card {
    padding: 1rem;
    background: var(--color-bg-alternate);
    border-radius: 6px;
    border-left: 4px solid var(--color-primary);
}

.forecast-card h4 {
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

/* Forecast Tables */
.forecast-table-section {
    background: var(--color-bg-card);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.forecast-table h3 {
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.forecast-table table {
    width: 100%;
    border-collapse: collapse;
}

.forecast-table th {
    background: var(--color-bg-alternate);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.forecast-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.forecast-table tbody tr:hover {
    background: var(--color-bg-alternate);
}

.forecast-table .icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.forecast-table .text {
    font-size: 0.9rem;
}

/* =====================================================
   FOOTER
   ===================================================== */

.site-footer {
    background: var(--color-primary);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.site-footer a {
    color: var(--color-secondary);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.error-message {
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    color: #856404;
}

.coming-soon {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* =====================================================
   ACCESSIBILITY - SCREEN READER ONLY
   ===================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* =====================================================
   RESPONSIVE - TABLET/MOBILE (< 768px)
   ===================================================== */

@media (max-width: 768px) {
    .header-title .site-title {
        font-size: 2rem;
    }
}
    
    .site-logo {
        width: 80px;
        height: 80px;
    }
    
    .header-title h1 {
        font-size: 2rem;
    }
    
    .header-title .tagline {
        font-size: 1rem;
    }
    
    .header-title .tagline-secondary {
        font-size: 0.85rem;
    }
    
    /* SHOW hamburger on mobile */
    .header-toggle {
        display: block !important;
    }
    
    /* HIDE desktop nav bar by default on mobile */
    .header-nav {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        display: none;
        overflow: hidden;
    }
    
    /* SHOW when hamburger is clicked */
    .header-nav.active {
        display: block !important;
        margin-top: 1rem;
    }
    
    /* Stack nav vertically on mobile */
    .main-nav {
        flex-direction: column;
        gap: 0;
        background: rgba(0,0,0,0.1);
        border-radius: 8px;
        padding: 0.5rem 0;
    }
    
    .main-nav a {
        padding: 1rem 1.5rem;
        text-align: center;
        border-radius: 0;
        width: 100%;
        display: block;
    }
    
    .main-nav a:hover {
        background: rgba(255,255,255,0.15);
    }
    
    /* Temperature Widget */
    .temp-widget {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .temp-widget-main {
        font-size: 2rem;
    }
    
    .temp-widget-trend {
        font-size: 1.1rem;
    }
    
    .temp-widget-change {
        font-size: 0.95rem;
    }
    
    /* Camera sections - even less padding on mobile */
    .camera-section,
    .cameras-section {
        padding: 1rem;
    }
    
    /* Other responsive tweaks */
    .temp-display .temp {
        font-size: 3rem;
    }
    
    .conditions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .forecast-table {
        overflow-x: auto;
    }
    
    .forecast-table table {
        font-size: 0.85rem;
    }
    
    .forecast-table th,
    .forecast-table td {
        padding: 0.5rem;
    }
}

/* =====================================================
   RESPONSIVE - SMALL MOBILE (< 480px)
   ===================================================== */

@media (max-width: 480px) {
    .header-title .site-title {
        font-size: 1.5rem;
    }
}
    
    .site-logo {
        width: 60px;
        height: 60px;
    }
    
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .header-title .tagline {
        font-size: 0.9rem;
    }
    
    .header-title .tagline-secondary {
        font-size: 0.8rem;
    }
    
    /* Camera sections - minimal padding on small screens */
    .camera-section,
    .cameras-section {
        padding: 0.75rem;
    }
}