/* Basic Dark Theme */
body {
    margin: 0;
    font-family: sans-serif;
    background: linear-gradient(180deg, #1A2035 0%, #0C1427 100%); /* Gradient from lighter to darker */
    color: #E0E0E0; /* Light grey text */
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure body takes full height */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

#app-container {
    flex: 1; /* Allows main content to grow */
    display: flex;
    flex-direction: column;
    /* Ensure top nav height is accounted for if fixed, including safe area for iPhone notch/dynamic island */
    padding-top: calc(60px + env(safe-area-inset-top)); /* Dynamic padding for safe area */
    width: 100%;
}

/* Make Top Nav sticky */
header#top-nav {
    background-color: #1A2035; /* Slightly lighter dark shade */
    padding: 10px 20px; /* Increased horizontal padding */
    min-height: 40px; /* Adjust as needed */
    height: 40px; /* Fixed height */
    display: flex;
    align-items: center;
    justify-content: space-between; /* Distribute items */
    border-bottom: 1px solid #2a314d; /* Subtle separator */
    position: fixed; /* Fix it to the top */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000; /* Ensure it stays above other content */
    padding-top: calc(10px + env(safe-area-inset-top)); /* Add original padding + safe area */
}

/* Location Search styling */
.location-search-container {
    display: flex;
    align-items: center;
    background-color: rgba(12, 20, 39, 0.6); /* Darker semi-transparent background */
    border-radius: 20px; /* Rounded corners */
    padding: 5px 10px;
    width: 70%; /* Responsive width */
    max-width: 300px;
}

#location-input {
    background: transparent;
    border: none;
    color: #E0E0E0;
    padding: 5px;
    width: 100%;
    font-size: 0.95em;
}

#location-input::placeholder {
    color: #a0a0a0;
}

#location-input:focus {
    outline: none;
}

#location-search-btn {
    background: none;
    border: none;
    color: #87CEEB; /* Accent color for the search icon */
    font-size: 1em;
    padding: 5px;
    cursor: pointer;
}

#top-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 20px; /* Increased gap for right-side items */
}

#top-nav .nav-center {
    margin-left: auto; /* Push center to the middle */
    margin-right: auto;
    font-weight: bold;
}

#top-nav button {
    background: none;
    border: none;
    color: #E0E0E0;
    font-size: 1.2em;
    cursor: pointer;
}

#top-nav #app-title {
    font-weight: bold;
    /* Maybe style this more later */
}

main#main-content {
    flex: 1; /* Take remaining space */
    overflow-y: auto; /* Allow scrolling if content overflows */
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
    /* Remove incorrect sticky positioning and padding */
    /* position: sticky; */ 
    /* bottom: 0; */
    /* border-top: 1px solid #2a314d; */ /* Maybe remove if redundant */
    display: flex;
    /* justify-content: space-around; */ /* Remove, views manage their own content */
    /* align-items: center; */ /* Remove, views manage their own content */
    /* padding-top: var(--top-nav-height); */ /* Remove */
    flex-direction: column; /* Ensure views stack vertically */
    /* Ensure main content respects the padded nav bars */
    /* Remove direct padding-top/bottom if nav bars are not fixed */
    /* padding-top: 70px; */ /* Adjust if top-nav height changes */
    /* padding-bottom: 70px; */ /* Adjust if bottom-nav height changes */
}

footer#bottom-nav {
    background-color: #1A2035; /* Match top nav */
    padding: 10px 15px;
    min-height: 50px; /* Example height */
    position: sticky; /* Keep it visible */
    bottom: 0;
    display: flex; /* Add this */
    justify-content: space-around; /* Add this */
    align-items: center; /* Vertically align items in the bar */
    border-top: 1px solid #2a314d; /* Subtle separator like in image */
    padding-bottom: calc(10px + env(safe-area-inset-bottom)); /* Add original padding + safe area */
    z-index: 1000; /* Ensure bottom nav stays above content */
}

#bottom-nav .nav-item {
    background: none;
    border: none;
    color: #E0E0E0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0;
    font-size: 0.8em;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease; /* Add transition */
}

#bottom-nav .nav-item:hover {
    opacity: 0.9; /* Slightly less transparent on hover */
    transform: scale(1.05); /* Scale up slightly */
}

#bottom-nav .nav-item i {
    font-size: 1.5em; /* Larger icons */
    margin-bottom: 3px;
}

#bottom-nav .nav-item.active {
    opacity: 1;
    font-weight: bold;
    color: #87CEEB; /* Use an accent color for active state */
    transform: translateY(-2px); /* Lift active item slightly */
}

/* ------- Weather View Styles -------- */

.weather-view {
    display: none; /* Hide views by default */
    flex-direction: column;
    gap: 15px; /* Spacing between elements in the view */
    width: 100%;
    box-sizing: border-box;
    padding-top: 10px; /* Extra top padding to prevent content cutoff on all views */
}

.weather-view.active-view {
    display: flex; /* Show the active view */
}

/* General section styling to prevent horizontal overflow */
.section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Today View Specific Styles */
#today-view {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center items horizontally */
    text-align: center; /* Center text within block elements */
    padding: 15px;
    box-sizing: border-box;
    width: 100%;
    background: linear-gradient(180deg, #1A2035 0%, #0C1427 100%); /* Gradient from lighter to darker */
    min-height: 100vh;
}

/* NEW/UPDATED Current Conditions Styling */
.current-conditions {
    display: flex;
    justify-content: space-around; /* Space out temp details and icon */
    align-items: center; /* Align them vertically */
    width: 100%;
    max-width: 400px; /* Limit width */
    margin-bottom: 15px; /* Add space below */
}

.temp-main {
    display: flex;
    flex-direction: column; /* Stack temp, feels, humidity */
    align-items: flex-start; /* Align text to the left */
}

#current-temp {
    font-size: 5em; /* Much larger temperature */
    font-weight: 300; /* Lighter font weight */
    line-height: 1; /* Adjust line height */
}

#realfeel-temp,
#current-humidity,
#current-wind,
#current-wind-gust {
    font-size: 1.1em; /* Slightly larger */
    opacity: 0.8;
    margin-top: 5px; /* Space below main temp */
}

.weather-icon-container {
    text-align: right; /* Align icon to the right within its container */
}

#current-weather-icon {
    font-size: 5.6em; /* slightly larger than the temp (5em) */
    color: #87CEEB; /* fallback color if FA is used */
    line-height: 1; /* avoid vertical stretch */
    font-style: normal; /* prevent <i> default italics skewing the glyph */
    display: inline-block; /* ensure no flex stretching */
}

/* When we use colored emoji HTML, ensure size and alignment */
#current-weather-icon .emoji-icon {
    font-size: 1em; /* inherit exact size from container */
    line-height: 1;
    display: inline-block;
    width: 1em; /* force a square box */
    height: 1em; /* force a square box */
    object-fit: contain; /* avoid distortion inside the box */
}

/* END NEW/UPDATED Current Conditions Styling */

#today-view .section.daily-forecast {
    max-width: 100%;
    overflow: hidden;
}

/* Daily Forecast Container and Scrolling */
.daily-forecast-container, #today-view .daily-forecast-container {
    width: 100%;
    margin: 8px 0; /* tighter spacing around header area */
    overflow: hidden;
}

.daily-forecast-scroll, #today-view .daily-forecast-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #87CEEB #1A2035;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
}

.daily-forecast-scroll::-webkit-scrollbar {
    height: 8px;
}

.daily-forecast-scroll::-webkit-scrollbar-track {
    background: #1A2035;
    border-radius: 4px;
}

.daily-forecast-scroll::-webkit-scrollbar-thumb {
    background-color: #87CEEB;
    border-radius: 4px;
    border: 2px solid #1A2035;
}

.daily-forecast-items, #today-view .daily-forecast-items {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0px;
    padding: 0 8px 0 0; /* remove left padding so first column starts further left */
}

/* Daily Forecast Column Style */
.daily-forecast-column {
    min-width: 64px; /* tighter column to reduce horizontal spacing */
    flex-shrink: 0;
    padding: 6px 0px;
    border-right: none;
}

.daily-forecast-column:last-child {
    border-right: none;
}

/* New compact daily card layout (day/night icons + vertical bar) */
.daily-forecast-column .daily-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background-color: transparent;
    border-radius: 10px;
    padding: 6px 0px;
    min-width: 76px; /* narrower card for reduced spacing */
}

.daily-card .daily-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.daily-card .dow { font-weight: bold; font-size: 0.9em; opacity: 0.9; }
.daily-card .date { font-size: 0.95em; opacity: 0.85; }

.daily-card .day-icon, .daily-card .night-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.daily-card .day-icon i, .daily-card .night-icon i { color: #87CEEB; font-size: 1.2em; }
.daily-card .emoji-icon { font-size: 1.4em; line-height: 1; }
.daily-card .day-icon .precip, .daily-card .night-icon .precip { color: #FFFFFF; font-size: 0.85em; }

.daily-card .temps { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.daily-card .temp-bar {
    position: relative;
    height: 210px; /* slightly taller visual */
    width: 34px;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
}
.daily-card .temp-fill {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    background: linear-gradient(to bottom, #eeeeee, #7a7a7a);
    border-radius: 12px;
}
.daily-card .temp-label {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 1.1em;
    pointer-events: none;
}
.daily-card .temp-label.low { font-weight: 600; }

/* Style the Bottom Summary Section */
#daily-current-summary {
    display: flex; /* Use flexbox */
    justify-content: space-around;
    align-items: stretch;
    padding: 20px 10px;
    margin-top: 20px;
    border-top: 1px solid #2a314d;
}

/* Shared Summary Item Styles (Used by Daily & Hourly) */
.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px; /* Space between label and value */
}

.summary-item .label {
    font-size: 0.9em;
    opacity: 0.7;
    text-transform: uppercase;
}

.summary-item .value {
    font-size: 1.3em;
    font-weight: bold;
    color: #FFFFFF;
}

/* Specific Styles for Hourly Bottom Summary */
#hourly-current-summary {
    display: flex !important; /* Use flexbox - Force override */
    flex-direction: row !important; /* Explicitly set horizontal layout - Force override */
    justify-content: center; /* Center items horizontally */
    align-items: center; /* Center items vertically */
    gap: 50px; /* Adjust space BETWEEN the items */
    padding: 15px 10px; /* Padding */
    margin-top: 15px; /* Space above */
    border-top: 1px solid #2a314d; /* Separator line */
    background-color: rgba(26, 32, 53, 0.5); /* Faint background */
    border-radius: 0 0 8px 8px; /* Optional: round bottom corners if desired */
}

/* Optional: Adjustments specific to hourly summary items if needed */
#hourly-current-summary .summary-item .value {
     font-size: 1.2em; /* Slightly smaller than daily maybe? */
}

/* --- Ensure visibility is handled correctly --- */
/* Define daily-content-container if needed, or ensure general visibility rules apply */
/* By default, all sections within #daily-view will be shown when it's active */
/* We only hide the #daily-chart-container explicitly via inline style for now */


/* ------- Daily Forecast Specific Item Styling (Redesigned) -------- */
.forecast-item.daily-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Increased gap for better spacing */
    min-width: 75px; /* Slightly wider items */
    padding: 15px 10px; /* More vertical padding */
    background-color: #1A2035;
    border-radius: 10px; /* Slightly more rounded */
    text-align: center;
    flex-shrink: 0; /* Prevent shrinking in the flex container */
}

.daily-item .day-abbr {
    font-weight: bold;
    font-size: 0.9em;
    opacity: 0.8;
}

.daily-item .date-num {
    font-size: 1.1em;
    font-weight: bold;
}

.daily-item .weather-icon {
    font-size: 1.8em; /* Slightly larger icon */
    color: #87CEEB;
    margin: 5px 0;
}

/* NEW Styles for Temp Display */
.daily-item .temp-details {
    display: flex;
    flex-direction: column; /* Stack High/Low */
    align-items: center;
    gap: 2px; /* Small gap between high/low */
    margin: 5px 0; /* Vertical margin */
}

.daily-item .high-temp {
    font-weight: bold;
    font-size: 1.2em; /* Make high temp prominent */
    color: #FFFFFF;
}

.daily-item .low-temp {
    font-size: 1.0em;
    opacity: 0.7; /* Make low temp less prominent */
    color: #E0E0E0;
}

/* Remove Old Bar Styles */
/* .daily-item .temp-bar { display: none; } */
/* .daily-item .temp-bar-inner { display: none; } */

.daily-item .precip {
    font-size: 0.9em;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px; /* Slightly more gap for precip */
}

.daily-item .precip i {
    font-size: 0.9em;
    color: #87CEEB;
}

/* Add styles for Hourly View */
#hourly-view {
    display: flex;
    flex-direction: column;
    padding: 10px 2px; /* Reduced horizontal padding to give more space */
    box-sizing: border-box;
    background: linear-gradient(180deg, #1A2035 0%, #0C1427 100%); /* Gradient from lighter to darker */
    min-height: 100vh;
}

/* NEW/UPDATED Hourly View Header Styles */
.view-header {
    display: flex;
    justify-content: space-between; /* Title on left, controls on right */
    align-items: center; /* Vertically align title and controls */
    margin-top: 5px; /* Extra space at top to prevent cutoff */
    margin-bottom: 15px; /* Space below header */
    padding: 0 10px; /* Horizontal padding */
}

.view-header h2 {
    margin: 0; /* Remove default margin */
    font-size: 1.5em;
    font-weight: bold;
}

.view-header .controls {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between toggle group and temp toggle */
}

.view-toggle-group {
    display: flex;
    border: none; /* Remove blue border */
    border-radius: 5px; /* Slightly rounded corners */
    overflow: hidden; /* Clip children to rounded corners */
}

.view-toggle {
    background-color: transparent; /* Default background */
    color: #E0E0E0;
    border: none;
    padding: 5px 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.view-toggle:not(:last-child) {
    border-right: 1px solid rgba(135, 206, 235, 0.3); /* Subtle separator line */
}

.view-toggle.active {
    background-color: #87CEEB; /* Accent background for active */
    color: #0C1427; /* Dark text for active */
}

.view-toggle:hover:not(.active) {
    background-color: rgba(135, 206, 235, 0.2); /* Subtle hover effect */
}

.temp-toggle {
    background-color: transparent;
    color: #E0E0E0;
    border: 1px solid #555; /* Subtle border */
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.temp-toggle:hover {
    background-color: #2a314d; /* Slightly lighter on hover */
    border-color: #777;
}

/* END NEW/UPDATED Hourly View Header Styles */

#hourly-forecast-items {
    display: flex !important; /* Always show the list by default */
    flex-direction: column;
    gap: 10px;
    padding: 10px 5px; /* Reduced horizontal padding */
    margin: 0 auto;
    max-width: 100%; /* Ensure it uses full available width */
    width: 98%; /* Increased from 95% to 98% to make container wider */
    align-items: center;
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Hide chart container by default */
#hourly-forecast-chart-container, 
#hourly-detail-scroll-container {
    display: none !important; /* Hide by default */
}

/* Add style for the chart container */
#hourly-forecast-chart-container {
    position: relative; /* Needed for chart.js responsiveness */
    min-height: 300px; /* Give it some default height */
    width: 100%;
    margin-bottom: 15px; /* Space below the chart */
}

/*
   REMOVING the general .hourly-item styles below 
   as they likely conflict with the specific list view styles 
   and were causing layout issues. 
   The specific list view styles start further down.
*/

/*
.hourly-item {
    display: flex;
    align-items: center;
    justify-content: space-between; 
    padding: 12px 10px; 
    border-bottom: 1px solid #2a314d; 
    gap: 10px; 
}

.hourly-item:last-child {
    border-bottom: none;
}

.hourly-item .time {
    font-weight: bold;
    flex-basis: 15%; 
    text-align: left;
}

.hourly-item .weather-icon { 
    flex-basis: 10%;
    text-align: center;
}
.hourly-item .weather-icon i { 
    font-size: 1.5em; 
    color: #87CEEB; 
}

.hourly-item .temp {
    font-weight: bold;
    font-size: 1.2em;
    flex-basis: 15%; 
    text-align: center;
}

.hourly-item .realfeel {
    font-size: 0.9em;
    opacity: 0.8;
    flex-basis: 25%; 
    text-align: center; 
}

.hourly-item .precip {
    display: flex; 
    align-items: center;
    justify-content: center; 
    font-size: 0.9em;
    opacity: 0.8;
    flex-basis: 20%; 
    text-align: right;
}

.hourly-item .precip i {
    margin-right: 5px; 
    color: #87CEEB; 
}
*/

/* -------- Styling for Hourly LIST Items (Card Layout - Attempt 5 - SELECTOR FIX) -------- */
/* Remove potentially conflicting general rules first if they exist elsewhere */

/* Apply card styling and flex container settings */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card {
    background-color: #1A2035; 
    border-radius: 8px; 
    padding: 10px 8px; /* Further reduced padding */
    border-bottom: none; /* No line */
    gap: 2px; /* Further reduced gap between elements */
    align-items: center;
    display: flex; 
    justify-content: flex-start; /* Align items to start, control spacing manually */
    width: 96%; /* Increased from 92% to 96% for wider cards */
    max-width: 420px; /* Increased from 380px to 420px */
    margin-bottom: 10px; /* Space between cards */
    border: 2px solid transparent; /* Default transparent border */
    transition: border-color 0.3s ease; /* Smooth transition for border color */
    box-sizing: border-box; /* Include padding and border in width calculation */
}

/* High precipitation probability styling */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card.high-precip {
    border: 2.5px solid #4dabf7; /* Slightly thicker blue border */
    box-shadow: 0 0 8px rgba(77, 171, 247, 0.6), /* Brighter primary glow */
                0 0 16px rgba(77, 171, 247, 0.3); /* Wider secondary glow */
    position: relative; /* For pseudo-element glow */
    z-index: 1; /* Ensure proper stacking */
}

/* High real feel temperature styling */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card.high-temp {
    border: 2.5px solid #ff3b30; /* Slightly thicker red border */
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.7), /* Brighter primary glow */
                0 0 16px rgba(255, 59, 48, 0.4); /* Wider secondary glow */
    position: relative; /* For pseudo-element glow */
    z-index: 1; /* Ensure proper stacking */
}

/* Low real feel temperature styling */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card.low-temp {
    border: 2.5px solid #4dabf7; /* Blue border for cold temperatures */
    box-shadow: 0 0 8px rgba(77, 171, 247, 0.7), /* Brighter primary glow */
                0 0 16px rgba(77, 171, 247, 0.4); /* Wider secondary glow */
    position: relative; /* For pseudo-element glow */
    z-index: 1; /* Ensure proper stacking */
}

/* Combined high precipitation and high temperature styling */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card.high-precip.high-temp {
    border: 2.5px solid #ff3b30; /* Prioritize high temperature warning with bright red */
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.7), /* Enhanced primary red glow */
                0 0 20px rgba(255, 59, 48, 0.4), /* Enhanced secondary red glow */
                0 0 8px rgba(77, 171, 247, 0.3); /* Enhanced blue accent */
}

/* Combined high precipitation and low temperature styling */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card.high-precip.low-temp {
    border: 2.5px solid #4dabf7; /* Prioritize low temperature warning with blue */
    box-shadow: 0 0 10px rgba(77, 171, 247, 0.7), /* Enhanced primary blue glow */
                0 0 20px rgba(77, 171, 247, 0.4), /* Enhanced secondary blue glow */
                0 0 8px rgba(77, 171, 247, 0.3); /* Enhanced blue accent */
}

/* High precipitation probability styling with pseudo-element glow */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card.high-precip::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 10px; /* Slightly larger than the card's border radius */
    background: transparent;
    box-shadow: 0 0 15px 2px rgba(77, 171, 247, 0.5); /* Outer glow */
    z-index: -1;
    pointer-events: none; /* Don't interfere with clicks */
}

/* High temperature styling with pseudo-element glow */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card.high-temp::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 10px; /* Slightly larger than the card's border radius */
    background: transparent;
    box-shadow: 0 0 15px 2px rgba(255, 59, 48, 0.6); /* Outer glow */
    z-index: -1;
    pointer-events: none; /* Don't interfere with clicks */
}

/* Low temperature styling with pseudo-element glow */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card.low-temp::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 10px; /* Slightly larger than the card's border radius */
    background: transparent;
    box-shadow: 0 0 15px 2px rgba(77, 171, 247, 0.6); /* Outer glow */
    z-index: -1;
    pointer-events: none; /* Don't interfere with clicks */
}

/* Combined high precipitation and high temperature styling */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card.high-precip.high-temp::before {
    box-shadow: 0 0 15px 3px rgba(255, 59, 48, 0.6), /* Primary red glow */
                0 0 8px 1px rgba(77, 171, 247, 0.4); /* Secondary blue glow */
}

/* Combined high precipitation and low temperature styling */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card.high-precip.low-temp::before {
    box-shadow: 0 0 15px 3px rgba(77, 171, 247, 0.6), /* Primary blue glow */
                0 0 8px 1px rgba(77, 171, 247, 0.4); /* Secondary blue glow */
}

/* Reset flex defaults for children */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card > * {
    flex: none; /* No growing or shrinking by default */
    margin: 0; /* Reset margins */
    text-align: left; /* Default align left */
}

/* Style each element within the card */
#hourly-forecast-items.active-hourly-content .hourly-forecast-card .time {
    font-weight: bold;
    font-size: 0.85em; /* Smaller font */
    width: 2.8em; /* Further reduced width */
}

#hourly-forecast-items.active-hourly-content .hourly-forecast-card .weather-icon {
    text-align: center;
    width: 1.8em; /* Further reduced width */
    margin-right: -3px; /* Negative margin to pull temperature closer */
}
#hourly-forecast-items.active-hourly-content .hourly-forecast-card .weather-icon i {
    font-size: 1.7em; /* Smaller icon */
    color: #E0E0E0;
    line-height: 1; 
}

#hourly-forecast-items.active-hourly-content .hourly-forecast-card .temp {
    font-weight: bold; 
    font-size: 1.7em; /* Smaller temperature */
    text-align: right; 
    width: 2.5em; /* Further reduced width */
    margin-left: 0; /* Removed left margin to reduce space after icon */
}

#hourly-forecast-items.active-hourly-content .hourly-forecast-card .realfeel {
    font-size: 0.85em; /* Smaller font to fit "Real Feel" */
    opacity: 0.8;
    width: 6.5em; /* Increased width to fit "Real Feel" */
    margin-left: 0.3em; /* Less space */
    white-space: nowrap; /* Prevent text wrapping */
}

#hourly-forecast-items.active-hourly-content .hourly-forecast-card .precip {
    display: flex;
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    font-size: 0.9em;
    opacity: 0.9;
    width: 3em; /* Reduced width */
    margin-left: auto; /* Push to far right */
}
#hourly-forecast-items.active-hourly-content .hourly-forecast-card .precip i {
    color: #87CEEB; 
    font-size: 1.1em; 
    margin-bottom: 2px; 
}
/* -------- END Specific styling for Hourly LIST Items -------- */

/* Hide/Show Hourly Content Containers */
.hourly-content-container {
    display: none !important; /* Hide all hourly content sections by default */
    width: 100%;
}

/* Show active sections */
.hourly-content-container.active-hourly-content {
    display: block !important; /* Show the active ones */
}

/* Ensure vertical scroll container takes appropriate height when active */
#hourly-forecast-items.active-hourly-content {
    /* display: block; */ /* Already handled by the rule above */
    /* Removed max-height and overflow-y to prevent nested scrolling */
}

/* Adjust chart container size if needed */
#hourly-forecast-chart-container.active-hourly-content {
    height: 300px; /* Keep consistent height */
    /* margin-bottom: 15px; Removed, space handled by detail container margin */
}
#hourly-detail-scroll-container.active-hourly-content { display: block; }

/* Vertical scrollbar styles */
.vertical-scroll {
    /* Reiterate scrollbar styles if they weren't global */
    scrollbar-width: thin;
    scrollbar-color: #87CEEB #1A2035;
}

.vertical-scroll::-webkit-scrollbar {
    width: 8px;
}

.vertical-scroll::-webkit-scrollbar-track {
    background: #1A2035;
    border-radius: 4px;
}

.vertical-scroll::-webkit-scrollbar-thumb {
    background-color: #87CEEB;
    border-radius: 4px;
    border: 2px solid #1A2035;
}

.daily-forecast-scroll::-webkit-scrollbar {
    height: 8px;
}

.daily-forecast-scroll::-webkit-scrollbar-track {
    background: #1A2035;
    border-radius: 4px;
}

.daily-forecast-scroll::-webkit-scrollbar-thumb {
    background-color: #87CEEB;
    border-radius: 4px;
    border: 2px solid #1A2035;
}

/* Add specific scrollbar styles for Today view */
#today-view .daily-forecast-scroll::-webkit-scrollbar {
    height: 8px;
}

#today-view .daily-forecast-scroll::-webkit-scrollbar-track {
    background: #1A2035;
    border-radius: 4px;
}

#today-view .daily-forecast-scroll::-webkit-scrollbar-thumb {
    background-color: #87CEEB;
    border-radius: 4px;
    border: 2px solid #1A2035;
}

/* Maps View Styling */
#maps-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(180deg, #1A2035 0%, #0C1427 100%); /* Gradient from lighter to darker */
    min-height: 100vh;
}

#weather-map-container {
    height: 400px;
    width: 100%;
    margin: 10px 0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

#weather-map {
    height: 100%;
    width: 100%;
    background-color: #2A314D;
}

.layer-selector {
    margin: 10px 0;
}

#map-layer-select {
    background-color: #1A2035;
    border: 1px solid #2a314d;
    color: #E0E0E0;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.map-controls {
    margin: 10px 0;
    padding: 10px;
    background-color: #1A2035;
    border-radius: 10px;
}

.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.animation-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.map-btn {
    background-color: #2A314D;
    color: #E0E0E0;
    border: none;
    border-radius: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.map-btn:hover {
    background-color: #3A4163;
}

.map-btn:active {
    background-color: #87CEEB;
    color: #1A2035;
}

.slider {
    width: 90%;
    height: 5px;
    background: #2A314D;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 5px;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #87CEEB;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #87CEEB;
    cursor: pointer;
}

#time-display {
    margin-top: 10px;
    font-size: 14px;
    color: #87CEEB;
}

.map-legend {
    margin: 10px 0;
    padding: 10px;
    background-color: #1A2035;
    border-radius: 10px;
    max-height: 120px;
    overflow-y: auto;
}

.legend-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
}

#legend-content {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.legend-color {
    width: 20px;
    height: 10px;
    margin-right: 5px;
    border-radius: 2px;
}

.legend-value {
    font-size: 12px;
}

/* Weather Comment Styling */
#weather-comment {
    font-style: normal;
    color: #ffffff; /* Brighter color for better readability */
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 15px; /* Uniform padding */
    width: auto; /* Allow content to determine width */
    max-width: 92%; /* Slightly wider max width */
    align-self: center; /* Center the box horizontally */
    display: flex; /* Use flexbox for internal centering */
    justify-content: center; /* Center text horizontally within flex */
    align-items: center; /* Center text vertically within flex */
    opacity: 0;
    animation: fadeInSlideUp 0.8s ease-out forwards;
    animation-delay: 0.3s; /* Slight delay */
    /* Styled to make factual comments stand out and be readable */
    background-color: rgba(26, 32, 53, 0.8); /* More opaque background */
    border: 1px solid rgba(135, 206, 235, 0.5); /* More visible border */
    border-radius: 10px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Enhanced shadow */
    backdrop-filter: blur(5px); /* Blur effect behind the element */
    -webkit-backdrop-filter: blur(5px); /* For Safari support */
    line-height: 1.4; /* Improved line height for readability */
    font-size: 0.95rem; /* Slightly larger text */
    text-align: center; /* Center text */
    font-weight: 400; /* Slightly bolder than normal */
    letter-spacing: 0.2px; /* Slightly increased letter spacing */
}

/* Daily view summary styling (compact, matches Today comment vibe) */
#daily-overview {
    font-style: normal;
    color: #ffffff;
    margin: 8px auto 10px auto;
    padding: 12px;
    max-width: 92%;
    background-color: rgba(26, 32, 53, 0.75);
    border: 1px solid rgba(135, 206, 235, 0.45);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    line-height: 1.35;
    font-size: 0.95rem;
    text-align: center;
}

/* Animation Keyframes */
@keyframes fadeInSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Precipitation Summary */
#precipitation-summary {
    text-align: center;
    margin-top: 10px;
    color: #E0E0E0; /* Light grey */
    font-size: 0.9rem;
    /* ... existing code ... */
}

/* PWA Install Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Dark overlay */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Above everything */
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    box-sizing: border-box;
}

.popup-overlay.visible {
    display: flex; /* Show when visible */
}

.popup-content {
    background-color: #1A2035; /* Match nav background */
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    position: relative;
    color: #E0E0E0;
    border: 1px solid #2a314d;
}

/* Day Details modal specific tweaks */
.day-details-content {
    max-width: 480px;
    background-color: rgba(26, 32, 53, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 600px;
    margin: 20px;
}

/* Air Quality Discussion Modal Styles */
.aqi-discussion-content {
    max-width: 600px;
    background-color: rgba(26, 32, 53, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 500px;
    margin: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.aqi-discussion-content h2 {
    color: #87CEEB;
    margin-bottom: 20px;
    text-align: center;
}

#aqi-discussion-content {
    line-height: 1.6;
    color: #E0E0E0;
}

#aqi-discussion-content .key-messages {
    background: rgba(135, 206, 235, 0.1);
    border-left: 4px solid #87CEEB;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

#aqi-discussion-content .key-messages h3 {
    color: #87CEEB;
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
}

#aqi-discussion-content .key-messages ol {
    margin: 0;
    padding-left: 20px;
}

#aqi-discussion-content .key-messages li {
    margin-bottom: 8px;
    color: #FFFFFF;
}

#aqi-discussion-content .detailed-discussion {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#aqi-discussion-content .detailed-discussion h3 {
    color: #87CEEB;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
}

#aqi-discussion-content .detailed-discussion p {
    margin: 0 0 15px 0;
    text-align: justify;
}

#aqi-discussion-content .detailed-discussion p:last-child {
    margin-bottom: 0;
}

/* Make AQI value clickable */
#aqi-value {
    cursor: pointer;
    transition: color 0.2s ease;
}

#aqi-value:hover {
    color: #87CEEB;
}

#aqi-gauge-number {
    cursor: pointer;
    transition: color 0.2s ease;
}

#aqi-gauge-number:hover {
    color: #87CEEB;
}

/* Day Details Conditions Layout - matching Today View */
.day-details-conditions {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 15px auto;
}

.day-details-temp-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#day-details-temp {
    font-size: 5em;
    font-weight: 300;
    line-height: 1;
    color: #FFFFFF;
}

#day-details-temp-label {
    font-size: 1.1em;
    opacity: 0.8;
    margin-top: 5px;
    color: #E0E0E0;
}

.day-details-weather-icon-container {
    text-align: right;
}

#day-details-weather-icon {
    font-size: 6em;
    color: #FFFFFF;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

#day-details-weather-icon .emoji-icon {
    font-size: 1em;
    line-height: 1;
}

.day-details-precipitation {
    text-align: center;
    margin: 10px 0;
    color: #E0E0E0;
    font-size: 0.9rem;
}

.day-details-precipitation i {
    color: #87CEEB;
    margin-right: 5px;
}

.day-details-description {
    text-align: center;
    margin: 10px auto 20px auto;
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.35;
    padding: 12px;
    max-width: 92%;
    background-color: rgba(26, 32, 53, 0.75);
    border: 1px solid rgba(135, 206, 235, 0.45);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.day-details-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.day-details-metrics .metric {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.day-details-metrics .metric .label { 
    font-size: 0.8em; 
    color: #B0B0B0; 
    text-transform: uppercase; 
}
.day-details-metrics .metric .value { 
    font-size: 1.2em; 
    font-weight: 700; 
    color: #FFFFFF; 
}

.popup-content h2 {
    margin-top: 0;
    color: #FFFFFF; /* White color for title */
    text-align: center;
    margin-bottom: 20px;
}

.popup-content p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.popup-content ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.popup-content li {
    margin-bottom: 8px;
}

.popup-content i {
    color: #87CEEB; /* Accent for icons */
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    color: #a0a0a0;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.close-btn:hover {
    color: #E0E0E0;
}

/* Media query for smaller screens to further optimize hourly forecast cards */
@media screen and (max-width: 375px) {
    #hourly-forecast-items {
        width: 100%; /* Use full width on small screens */
        padding: 10px 1px; /* Minimal horizontal padding */
    }
    
    #hourly-forecast-items.active-hourly-content .hourly-forecast-card {
        padding: 10px 6px; /* Further reduce padding */
        gap: 1px; /* Minimal gap */
        width: 98%; /* Increased width on small screens */
    }
    
    #hourly-forecast-items.active-hourly-content .hourly-forecast-card .time {
        width: 2.8em; /* Smaller width */
        font-size: 0.9em; /* Smaller font */
    }
    
    #hourly-forecast-items.active-hourly-content .hourly-forecast-card .weather-icon {
        width: 1.6em; /* Smaller width */
        margin-right: -2px; /* Negative margin to pull temperature closer */
    }
    
    #hourly-forecast-items.active-hourly-content .hourly-forecast-card .temp {
        width: 2.4em; /* Smaller width */
        margin-left: 0; /* No left margin */
        font-size: 1.6em; /* Smaller font */
    }
    
    #hourly-forecast-items.active-hourly-content .hourly-forecast-card .realfeel {
        width: 5.5em; /* Smaller width */
        margin-left: 0.2em; /* Less space */
        font-size: 0.75em; /* Smaller font */
    }
    
    #hourly-forecast-items.active-hourly-content .hourly-forecast-card .precip {
        width: 2.2em; /* Smaller width */
        font-size: 0.8em; /* Smaller font */
        margin-left: auto; /* Push to right */
        margin-right: 0.2em; /* Add small right margin */
    }
    
    #hourly-forecast-items.active-hourly-content .hourly-forecast-card .weather-icon i {
        font-size: 1.5em; /* Smaller icon */
    }
}

/* Pollen Forecast Section Styles */
.pollen-forecast {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.pollen-forecast h2 {
    color: #FFFFFF;
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 15px;
}

.pollen-forecast h3 {
    color: #87CEEB;
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 10px;
}

.pollen-current {
    margin-bottom: 20px;
}

.pollen-today {
    text-align: center;
}

.pollen-types {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.pollen-type-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    min-width: 80px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pollen-type-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.pollen-type-name {
    font-size: 0.8em;
    color: #B0B0B0;
    margin-bottom: 3px;
}

.pollen-type-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #FFFFFF;
}

.pollen-type-status {
    font-size: 0.7em;
    margin-top: 2px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    color: #000000;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Pollen Chart Container */
#pollen-chart-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pollen-chart-container canvas {
    width: 95% !important; /* slightly inset to avoid touching edges */
    max-width: 520px; /* keep a comfortable reading width */
    height: 100% !important;
    display: block !important;
    margin: 0 auto; /* center the canvas inside container */
}

/* Daily Pollen Forecast */
.pollen-daily-forecast {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    margin: 15px 0;
    min-height: 80px;
    width: 100%;
    box-sizing: border-box;
}

.pollen-daily-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px;
    min-width: 120px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.pollen-daily-date {
    font-size: 0.9em;
    color: #87CEEB;
    margin-bottom: 8px;
    font-weight: 500;
}

.pollen-daily-types {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pollen-daily-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
}

.pollen-daily-type-name {
    color: #B0B0B0;
}

.pollen-daily-type-value {
    color: #000000;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 35px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Pollen Scale Legend */
.pollen-scale {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 30px;
}

.scale-item {
    display: flex;
    align-items: center;
    font-size: 0.7em;
    color: #B0B0B0;
}

.scale-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 5px;
}

/* Pollen Level Color Classes */
.pollen-very-low, .scale-color.pollen-very-low { background-color: #00e400; }
.pollen-low, .scale-color.pollen-low { background-color: #7dd321; }
.pollen-moderate, .scale-color.pollen-moderate { background-color: #ffff00; }
.pollen-high, .scale-color.pollen-high { background-color: #ff7e00; }
.pollen-very-high, .scale-color.pollen-very-high { background-color: #ff0000; }
.pollen-unknown, .scale-color.pollen-unknown { background-color: #B0B0B0; }

/* Pollen type specific colors */
.pollen-tree { color: #4CAF50; }
.pollen-grass { color: #8BC34A; }
.pollen-weed { color: #FF9800; }

/* Responsive design for pollen section */
@media (max-width: 600px) {
    .pollen-types {
        flex-direction: column;
        align-items: center;
    }
    
    .pollen-type-item {
        width: 100%;
        max-width: 200px;
    }
    
    .pollen-scale {
        flex-direction: column;
        gap: 5px;
    }
    
    .pollen-daily-forecast {
        padding: 10px 5px;
    }
    
    .pollen-daily-item {
        min-width: 100px;
        padding: 10px;
    }
}

/* Air Quality Gauge */
.aqi-gauge {
    position: relative;
    width: 260px; /* visual size similar to reference */
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.aqi-gauge canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.aqi-gauge-value {
    margin-top: 6px;
    text-align: center;
}

.aqi-gauge-value span {
    font-size: 2.2em;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Hide the small AQI + time row above the gauge for cleaner look */
.air-quality .air-quality-main { display: none; }

/* Air Quality Scale */
.air-quality-scale {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.scale-bar {
    display: flex;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.scale-segment {
    flex: 1;
    background-color: var(--segment-color);
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.8em;
    color: #B0B0B0;
    margin-top: 5px;
}

/* Air Quality Explanation */
.air-quality-explanation {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.air-quality-explanation p {
    margin: 0;
    font-size: 0.8em;
    color: #B0B0B0;
    text-align: center;
    line-height: 1.4;
}

.air-quality-explanation strong {
    color: #87CEEB;
}

/* Fix potential layout issues */
.weather-view:not(.active-view) {
    display: none !important;
}

/* Ensure proper spacing at bottom of content */
#today-view {
    padding-bottom: 20px;
}

/* Remove any unwanted white space */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #1A2035 0%, #0C1427 100%);
}

/* ========================================
   SnowCast Section Styles
   ======================================== */

.snowcast-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a7c 50%, #1e3a5f 100%);
    border-radius: 15px;
    padding: 16px;
    margin: 15px 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(135, 206, 235, 0.3);
}

.snowcast-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.snowcast-icon {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.snowcast-icon i {
    font-size: 1.8em;
    color: #87CEEB;
}

.snowcast-title h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
    color: #FFFFFF;
}

.snowcast-title p {
    margin: 4px 0 0 0;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
}

.snowcast-events {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* SnowCast Event Card */
.snowcast-event-card {
    background: linear-gradient(135deg, #3366cc 0%, #4d88ff 100%);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.snowcast-event-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.snowcast-event-card.ice-event {
    background: linear-gradient(135deg, #4a90d9 0%, #6baed6 100%);
}

.snowcast-event-card.alert-event {
    background: linear-gradient(135deg, #cc3333 0%, #e64545 100%);
}

.snowcast-event-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.event-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.event-icon i {
    font-size: 1.5em;
    color: rgba(255, 255, 255, 0.9);
}

.event-icon .snowflakes-small {
    font-size: 0.7em;
    color: #87CEEB;
    letter-spacing: 2px;
}

.event-details {
    display: flex;
    flex-direction: column;
}

.event-type {
    font-weight: 700;
    font-size: 1.05em;
    color: #FFFFFF;
}

.event-timing {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
}

.snowcast-event-right {
    display: flex;
    align-items: center;
}

.snowcast-event-right i {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   SnowCast Modal Styles
   ======================================== */

.snowcast-modal-content {
    background-color: #0C1427;
    max-width: 500px;
    min-height: 70vh;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    padding-top: 60px;
    border: 1px solid #2a3650;
}

/* Position close button with extra top space for safe area on mobile */
.snowcast-modal-content .close-btn {
    top: 30px;
    right: 15px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.snowcast-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.snowcast-modal-icon {
    flex-shrink: 0;
}

.snow-cloud-icon {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.snow-cloud-icon i {
    font-size: 3em;
    color: #B0C4DE;
}

.snow-cloud-icon .snowflakes {
    color: #87CEEB;
    font-size: 1.2em;
    letter-spacing: 4px;
    margin-top: -8px;
}

.snowcast-modal-title-wrap {
    flex: 1;
}

#snowcast-modal-title {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
    color: #FFFFFF;
}

#snowcast-modal-subtitle {
    margin: 5px 0 0 0;
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.7);
}

/* Timeline */
.snowcast-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 10px;
    margin-bottom: 20px;
}

.timeline-start,
.timeline-end {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.timeline-start {
    text-align: left;
}

.timeline-end {
    text-align: right;
}

.timeline-label {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.timeline-time {
    font-size: 1.4em;
    font-weight: 700;
    color: #FFFFFF;
}

.timeline-date {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

.timeline-connector {
    display: flex;
    align-items: center;
    flex: 1;
    margin: 0 15px;
    padding-top: 20px;
}

.timeline-dot {
    width: 8px;
    height: 8px;
    background-color: #FFFFFF;
    border-radius: 50%;
}

.timeline-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, 
        #FFFFFF 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        #FFFFFF 100%);
    border-style: dashed;
    margin: 0 5px;
}

/* Map Container */
.snowcast-map-container {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.snowcast-map {
    height: 180px;
    width: 100%;
    background: linear-gradient(180deg, #1A2035 0%, #2a3650 100%);
    position: relative;
}

/* When map has placeholder, use flex for centering */
.snowcast-map:has(.map-placeholder) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.4);
}

/* Ensure Leaflet map fills container */
.snowcast-map .leaflet-container {
    height: 100%;
    width: 100%;
    border-radius: 12px;
}

.map-placeholder i {
    font-size: 2.5em;
}

.map-placeholder span {
    font-size: 0.9em;
}

/* Probability Section */
.snowcast-probability-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.snowcast-probability-section h3 {
    margin: 0 0 15px 0;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.probability-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.probability-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
}

.probability-row.highlighted .prob-label {
    font-weight: 700;
    color: #FFFFFF;
}

.probability-row.highlighted .prob-value {
    font-weight: 700;
    color: #FFFFFF;
}

.prob-label {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.8);
}

.prob-value {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
    min-width: 35px;
}

.prob-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.prob-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4d88ff 0%, #87CEEB 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.probability-row.highlighted .prob-bar-fill {
    background: linear-gradient(90deg, #3366cc 0%, #4d88ff 100%);
}

/* Hourly Snowfall Section */
.snowcast-hourly-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.snowcast-hourly-section h3 {
    margin: 0 0 15px 0;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hourly-snow-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: #87CEEB #1A2035;
}

.hourly-snow-scroll::-webkit-scrollbar {
    height: 6px;
}

.hourly-snow-scroll::-webkit-scrollbar-track {
    background: #1A2035;
    border-radius: 3px;
}

.hourly-snow-scroll::-webkit-scrollbar-thumb {
    background-color: #87CEEB;
    border-radius: 3px;
}

.hourly-snow-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 50px;
    padding: 8px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    flex-shrink: 0;
}

.hourly-snow-time {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
}

.hourly-snow-amount {
    font-size: 0.9em;
    font-weight: 600;
    color: #87CEEB;
}

.hourly-snow-bar {
    width: 20px;
    background: rgba(135, 206, 235, 0.3);
    border-radius: 4px;
    overflow: hidden;
    min-height: 40px;
    display: flex;
    align-items: flex-end;
}

.hourly-snow-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #4d88ff 100%);
    border-radius: 4px;
    transition: height 0.3s ease;
}

/* Alerts Section */
.snowcast-alerts-section {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
}

.snowcast-alerts-section h3 {
    margin: 0 0 12px 0;
    font-size: 0.85em;
    color: #ff6b6b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.alert-item {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 10px;
}

.alert-item:last-child {
    margin-bottom: 0;
}

.alert-headline {
    font-weight: 600;
    color: #FFFFFF;
    font-size: 0.95em;
    margin-bottom: 8px;
}

.alert-description {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.alert-instruction {
    font-size: 0.85em;
    color: #ff9f43;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments for SnowCast */
@media screen and (max-width: 480px) {
    .snowcast-modal-content {
        padding: 15px;
        padding-top: 60px;
        min-height: 60vh;
    }

    #snowcast-modal-title {
        font-size: 1.5em;
    }

    .timeline-time {
        font-size: 1.2em;
    }

    .probability-row {
        grid-template-columns: 1fr auto 80px;
    }

    .snowcast-map {
        height: 150px;
    }
}

/* ========================================
   Mobile Menu Drawer Styles
   ======================================== */

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.menu-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.menu-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: linear-gradient(180deg, #1A2035 0%, #0C1427 100%);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 2001;
}

.menu-overlay.visible .menu-drawer {
    right: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #2a314d;
    position: sticky;
    top: 0;
    background: #1A2035;
    z-index: 10;
}

.menu-header h2 {
    margin: 0;
    color: #FFFFFF;
    font-size: 1.5em;
}

.menu-content {
    padding: 20px;
}

.menu-section {
    margin-bottom: 30px;
}

.menu-section h3 {
    color: #87CEEB;
    font-size: 1.1em;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-section h3 i {
    font-size: 1em;
}

/* Favorites List */
.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.favorite-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.favorite-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-4px);
}

.favorite-item-info {
    flex: 1;
}

.favorite-item-name {
    color: #FFFFFF;
    font-weight: 600;
    font-size: 1em;
    margin-bottom: 2px;
}

.favorite-item-coords {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8em;
}

.favorite-item-actions {
    display: flex;
    gap: 8px;
}

.favorite-delete-btn {
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #ff6b6b;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9em;
}

.favorite-delete-btn:hover {
    background: rgba(255, 59, 48, 0.3);
}

.menu-action-btn {
    width: 100%;
    background: rgba(135, 206, 235, 0.1);
    border: 1px solid rgba(135, 206, 235, 0.3);
    color: #87CEEB;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.menu-action-btn:hover {
    background: rgba(135, 206, 235, 0.2);
    border-color: rgba(135, 206, 235, 0.5);
}

.menu-action-btn i {
    font-size: 0.9em;
}

/* Settings List */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.setting-label {
    color: #E0E0E0;
    font-size: 0.95em;
}

.setting-control {
    display: flex;
    align-items: center;
}

.setting-toggle-btn {
    background: #87CEEB;
    color: #0C1427;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    min-width: 50px;
}

.setting-toggle-btn:hover {
    background: #6baed6;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #87CEEB;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.favorites-empty {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9em;
}

/* Menu button in top nav */
#menu-btn {
    background: none;
    border: none;
    color: #E0E0E0;
    font-size: 1.3em;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

#menu-btn:hover {
    color: #87CEEB;
}
