/* ANDYWEATHER - MODERN DASHBOARD STYLES
----------------------------------------------------------*/

/* CSS CUSTOM PROPERTIES (Dark Mode Support) */
:root {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #6c757d;
    --accent-primary: #4b6c9e;
    --accent-secondary: #3a5a8a;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --temp-cold: #3498db;
    --temp-cool: #2ecc71;
    --temp-warm: #f39c12;
    --temp-hot: #e74c3c;
    --card-radius: 12px;
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #1f2940;
    --text-primary: #e8e8e8;
    --text-secondary: #b0b0c0;
    --text-muted: #8888a0;
    --accent-primary: #6d8fc4;
    --accent-secondary: #5a7ab0;
    --border-color: #2a3a5a;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* DEFAULTS
----------------------------------------------------------*/

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

a:link, a:visited {
    color: var(--accent-primary);
    text-decoration: none;
}

a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

p {
    margin-bottom: 10px;
    line-height: 1.6em;
    color: var(--text-secondary);
}

/* HEADINGS
----------------------------------------------------------*/

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5em;
}

h1 { font-size: 1.8em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.2em; }

/* PRIMARY LAYOUT
----------------------------------------------------------*/

.page {
    max-width: 1200px;
    background-color: var(--bg-secondary);
    margin: 0 auto;
    min-height: 100vh;
    box-shadow: 0 0 20px var(--shadow-color);
}

.header {
    position: relative;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    width: 100%;
}

.header h1 {
    font-weight: 700;
    margin: 0;
    padding: 15px 20px;
    color: #fff;
    font-size: 1.8em;
    display: inline-block;
}

.main {
    padding: 20px;
    min-height: 500px;
}

.footer {
    color: var(--text-muted);
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
}

/* NAVIGATION
----------------------------------------------------------*/

div.hideSkiplink {
    background-color: var(--accent-secondary);
    width: 100%;
}

div.menu {
    padding: 0 8px;
}

div.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

div.menu ul li a, div.menu ul li a:visited {
    background-color: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    transition: background-color 0.2s;
}

div.menu ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* HEADER CONTROLS
----------------------------------------------------------*/

.header-controls {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.loginDisplay {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
}

.loginDisplay a:link, .loginDisplay a:visited, .loginDisplay a:hover {
    color: #fff;
}

/* WEATHER DASHBOARD
----------------------------------------------------------*/

.weather-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.weather-card {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s, background-color var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.weather-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.weather-card.featured {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
}

.weather-card.featured .card-label,
.weather-card.featured .card-secondary {
    color: rgba(255, 255, 255, 0.85);
}

.card-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.card-label {
    font-size: 0.85em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.card-value {
    font-size: 2.2em;
    font-weight: 700;
    line-height: 1.2;
    transition: opacity 0.3s;
}

.card-value.updating {
    opacity: 0.5;
}

.card-secondary {
    font-size: 1em;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-unit {
    font-size: 0.5em;
    font-weight: 400;
    opacity: 0.8;
}

/* Temperature Color Coding */
.temp-freezing { color: #9b59b6; }
.temp-cold { color: var(--temp-cold); }
.temp-cool { color: var(--temp-cool); }
.temp-warm { color: var(--temp-warm); }
.temp-hot { color: var(--temp-hot); }

/* WEATHER ICONS (SVG) */
.wx-icon {
    width: 48px;
    height: 48px;
    fill: currentColor;
    opacity: 0.8;
}

/* UPDATE STATUS
----------------------------------------------------------*/

.update-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--card-radius);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.9em;
}

.update-time {
    color: var(--text-secondary);
}

.update-countdown {
    color: var(--accent-primary);
    font-weight: 500;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* LOCATION INFO
----------------------------------------------------------*/

.location-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--card-radius);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.location-info a {
    font-weight: 500;
}

/* INTRO SECTION
----------------------------------------------------------*/

.intro-section {
    margin-bottom: 24px;
}

.intro-section h2 {
    margin-bottom: 8px;
}

/* RESPONSIVE DESIGN
----------------------------------------------------------*/

@media (max-width: 768px) {
    .page {
        margin: 0;
    }

    .header h1 {
        font-size: 1.4em;
        padding: 12px 15px;
    }

    .header-controls {
        position: static;
        transform: none;
        padding: 10px 15px;
        justify-content: flex-end;
        background: rgba(0, 0, 0, 0.1);
    }

    .main {
        padding: 15px;
    }

    .weather-dashboard {
        grid-template-columns: 1fr;
    }

    .weather-card.featured {
        grid-column: span 1;
    }

    .card-value {
        font-size: 1.8em;
    }

    div.menu ul {
        flex-wrap: wrap;
    }

    div.menu ul li a {
        padding: 10px 15px;
    }

    .update-status {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .weather-card {
        padding: 16px;
    }

    .card-value {
        font-size: 1.5em;
    }

    .theme-toggle span {
        display: none;
    }
}

/* UTILITIES
----------------------------------------------------------*/

.clear {
    clear: both;
}

.bold {
    font-weight: bold;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* LEGACY SUPPORT (for fallback)
----------------------------------------------------------*/

.WxMeasurement {
    color: var(--accent-primary);
    font-weight: 500;
}

.WxValue {
    font-weight: bold;
    color: var(--text-primary);
}

/* PRINT STYLES
----------------------------------------------------------*/

@media print {
    .header-controls,
    .theme-toggle,
    .update-countdown {
        display: none;
    }

    .page {
        box-shadow: none;
        border: none;
    }

    .weather-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
