/* Modern Web CSS - Meteorology Dashboard Design System */

:root {
    /* Font Families */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    
    /* Transition Settings */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Grid/Gap sizing */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
}

/* Theme Tokens: Dark Mode (Default) */
[data-theme="dark"] {
    --bg-app: #070b13;
    --bg-app-gradient: radial-gradient(circle at 50% 0%, #0e1726 0%, #06090e 100%);
    --bg-sidebar: rgba(10, 15, 26, 0.7);
    --bg-card: rgba(18, 27, 43, 0.45);
    --bg-card-hover: rgba(26, 39, 61, 0.6);
    --bg-input: rgba(12, 18, 30, 0.8);
    --border-card: rgba(255, 255, 255, 0.07);
    --border-card-hover: rgba(255, 255, 255, 0.15);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --accent-primary: #06b6d4;      /* Cyan */
    --accent-primary-hover: #22d3ee;
    --accent-primary-soft: rgba(6, 182, 212, 0.12);
    
    --accent-secondary: #6366f1;    /* Indigo */
    --accent-secondary-soft: rgba(99, 102, 241, 0.12);
    
    --alert-danger: #f43f5e;        /* Rose */
    --alert-danger-soft: rgba(244, 63, 94, 0.12);
    --alert-warning: #fbbf24;       /* Amber */
    --alert-warning-soft: rgba(251, 191, 36, 0.12);
    --alert-info: #3b82f6;          /* Blue */
    --alert-info-soft: rgba(59, 130, 246, 0.12);
    --alert-success: #10b981;       /* Emerald */
    --alert-success-soft: rgba(16, 185, 129, 0.12);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(16px);
    
    --color-link: #38bdf8;          /* Bright Sky Blue for readability */
    --color-link-hover: #7dd3fc;
}

/* Theme Tokens: Light Mode */
[data-theme="light"] {
    --bg-app: #f1f5f9;
    --bg-app-gradient: linear-gradient(180deg, #e2e8f0 0%, #f1f5f9 100%);
    --bg-sidebar: rgba(255, 255, 255, 0.85);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-input: rgba(241, 245, 249, 0.9);
    --border-card: rgba(15, 23, 42, 0.08);
    --border-card-hover: rgba(15, 23, 42, 0.15);
    
    --text-main: #0f172a;
    --text-muted: #576375;
    --text-inverse: #ffffff;
    
    --accent-primary: #0891b2;      /* Cyan */
    --accent-primary-hover: #0e7490;
    --accent-primary-soft: rgba(8, 145, 178, 0.1);
    
    --accent-secondary: #4f46e5;    /* Indigo */
    --accent-secondary-soft: rgba(79, 70, 229, 0.1);
    
    --alert-danger: #e11d48;        /* Rose */
    --alert-danger-soft: rgba(225, 29, 72, 0.08);
    --alert-warning: #d97706;       /* Amber */
    --alert-warning-soft: rgba(217, 119, 6, 0.08);
    --alert-info: #2563eb;          /* Blue */
    --alert-info-soft: rgba(37, 99, 235, 0.08);
    --alert-success: #059669;       /* Emerald */
    --alert-success-soft: rgba(5, 150, 105, 0.08);
    
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 6px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 24px rgba(15, 23, 42, 0.1);
    --glass-blur: blur(20px);
    
    --color-link: #0284c7;          /* Classic high-contrast blue */
    --color-link-hover: #0369a1;
}

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

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-app);
    background-image: var(--bg-app-gradient);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

/* App Container Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-card);
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.brand-icon i {
    width: 22px;
    height: 22px;
}

.brand-name h1 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--text-main);
}

.brand-name span {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 6px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item i {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item:hover i {
    transform: translateX(2px);
}

.nav-item.active {
    color: var(--text-inverse);
    background: var(--text-main);
    font-weight: 600;
}

[data-theme="dark"] .nav-item.active {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .nav-item.active {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.warning-count-badge {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--alert-danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    display: none; /* Shown dynamically */
    box-shadow: var(--shadow-sm);
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.glossary-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--accent-primary-soft);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.glossary-btn:hover {
    background: var(--accent-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

/* Sidebar Region Selector */
.sidebar-region-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.region-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    padding-left: 2px;
}

.region-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.region-select-icon {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.region-select {
    width: 100%;
    padding: 10px 10px 10px 34px;
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all var(--transition-fast);
}

.region-select:hover {
    border-color: var(--border-card-hover);
    background: var(--bg-card-hover);
}

.region-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-soft);
}

/* Custom dropdown arrow for region selector */
.region-select-wrapper::after {
    content: "";
    position: absolute;
    right: 12px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    pointer-events: none;
}

.mobile-region-selector-container {
    display: none;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--text-muted);
}

.theme-toggle-btn i {
    width: 16px;
    height: 16px;
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding: 0 40px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0 20px 0;
    border-bottom: 1px solid var(--border-card);
    position: sticky;
    top: 0;
    background: transparent;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.header-title-area h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.meta-subtitle {
    display: flex;
    gap: 20px;
    margin-top: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item i {
    width: 14px;
    height: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Office Region Selector */
.office-selector-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.office-selector-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.office-selector-container i {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.office-select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    padding-right: 4px;
}

.office-select option {
    background: var(--bg-app);
    color: var(--text-main);
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    position: relative;
    width: 280px;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.clear-search-btn:hover {
    color: var(--text-main);
}

/* Autocomplete Location Search Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-card-hover);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    text-align: left;
}

.search-result-item:hover {
    background: var(--bg-card-hover);
}

.search-result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.search-result-subtitle {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.search-result-no-results {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.clear-search-btn i {
    width: 16px;
    height: 16px;
}

/* Alert Badge */
.alert-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.alert-status-badge i {
    width: 16px;
    height: 16px;
}

.alert-status-badge.no-alerts {
    background: var(--alert-success-soft);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--alert-success);
}

.alert-status-badge.has-alerts {
    background: var(--alert-danger-soft);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--alert-danger);
    animation: alert-pulse 2s infinite ease-in-out;
}

@keyframes alert-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 10px rgba(244, 63, 94, 0.2); }
    100% { transform: scale(1); }
}

/* Content Body */
.content-body {
    flex: 1;
    padding: 30px 0;
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fade-in var(--transition-normal);
}

.tab-panel.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphism Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-normal), background-color var(--transition-normal), box-shadow var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-lg);
}

.glass-card {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    width: 22px;
    height: 22px;
}

.card-title h3 {
    font-size: 17px;
    font-weight: 700;
}

.card-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--accent-secondary-soft);
    color: var(--accent-secondary);
}

.card-body {
    padding: 24px;
}

/* Overview Layout Grids */
.overview-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

.span-col-2 {
    grid-column: span 2;
}

/* Welcome Card */
.welcome-card {
    padding: 30px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.45) 100%);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .welcome-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(241, 245, 249, 0.8) 100%);
}

.welcome-content {
    z-index: 2;
}

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.badge-primary {
    background: var(--accent-primary-soft);
    color: var(--accent-primary);
}

.welcome-card h3 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.welcome-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 90%;
}


/* Radar Mockup Visual */
.welcome-visual {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.radar-radar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 1px solid rgba(6, 182, 212, 0.15);
    background: radial-gradient(circle, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
    position: relative;
    overflow: hidden;
}

.radar-radar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(6, 182, 212, 0.15);
}

.radar-radar::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(6, 182, 212, 0.15);
}

.radar-sweep {
    position: absolute;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg at 50% 50%, rgba(6, 182, 212, 0.3) 0deg, transparent 90deg, transparent 360deg);
    border-radius: 50%;
    transform-origin: center;
    animation: radar-spin 4s linear infinite;
}

@keyframes radar-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.radar-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
}

.radar-dot.dot1 { top: 30%; left: 70%; animation: pulse-opacity 2s infinite 0.5s; }
.radar-dot.dot2 { top: 60%; left: 25%; animation: pulse-opacity 2s infinite 1.2s; }
.radar-dot.dot3 { top: 40%; left: 45%; animation: pulse-opacity 2s infinite 0s; }

@keyframes pulse-opacity {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 0.2; }
    100% { opacity: 0; }
}

/* Key Messages List */
.key-messages-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.key-messages-list li {
    display: flex;
    gap: 12px;
    font-size: 14px;
    line-height: 1.2;
}

.key-messages-list li p {
    line-height: 1.2;
}

.km-bullet {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-primary-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.km-bullet i {
    width: 14px;
    height: 14px;
}

/* Quick Alerts Body */
.quick-alerts-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
}

.qa-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qa-icon i {
    width: 18px;
    height: 18px;
}

.qa-info {
    flex: 1;
}

.qa-info h4 {
    font-size: 13px;
    font-weight: 700;
}

.qa-info p {
    font-size: 11px;
    color: var(--text-muted);
}

/* Met Briefing Card */
.briefing-summary-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.briefing-section h4 {
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-update { background: var(--accent-primary); }
.dot-short { background: var(--accent-secondary); }
.dot-long { background: var(--alert-warning); }

.briefing-section p {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.8;
    margin-bottom: 12px;
}
.briefing-section p:last-child {
    margin-bottom: 0;
}

/* Discussion tab with side index */
.section-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 24px;
    align-items: start;
}

.section-main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.discussion-block {
    scroll-margin-top: 100px;
}

.card-header-main {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.issued-time-detail {
    font-size: 12px;
    color: var(--text-muted);
}

.badge-update { background: var(--accent-primary-soft); color: var(--accent-primary); }
.badge-short-term { background: var(--accent-secondary-soft); color: var(--accent-secondary); }
.badge-long-term { background: var(--alert-warning-soft); color: var(--alert-warning); }

/* Formatted meteorological text blocks */
.formatted-text {
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text-main);
    padding: 24px;
}

.formatted-text p {
    margin-bottom: 16px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.glossary-parsed-text {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.formatted-text p:last-child {
    margin-bottom: 0;
}

.formatted-text .issue-signature {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    border-top: 1px dashed var(--border-card);
    padding-top: 12px;
    display: inline-block;
}

/* Custom styles for anchors loaded from NWS Glossary */
.glossary-link,
.formatted-text a {
    color: var(--color-link);
    text-decoration: none;
    border-bottom: 1px dashed var(--color-link);
    cursor: help;
    transition: all var(--transition-fast);
}

.glossary-link:hover,
.formatted-text a:hover {
    color: var(--color-link-hover);
    background: var(--accent-primary-soft);
    border-bottom-style: solid;
}

/* Discussion Table of Contents */
.section-toc {
    position: sticky;
    top: 100px;
}

.toc-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 20px;
}

.toc-wrapper h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.toc-list {
    list-style: none;
}

.toc-item {
    display: block;
    padding: 8px 12px;
    border-left: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.toc-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.toc-item.active {
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 600;
    background: var(--accent-primary-soft);
}

/* Aviation view box */
.taf-alert-box {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--accent-secondary-soft);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    margin: 24px;
    align-items: center;
}

.taf-alert-box i {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.taf-alert-box h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.taf-alert-box p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Marine Hazards */
.marine-hazard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px;
}

.marine-hazard-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-md);
    align-items: center;
}

.marine-hazard-card i {
    width: 28px;
    height: 28px;
}

.gale-hazard {
    background: var(--alert-danger-soft);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--alert-danger);
}

.seas-hazard {
    background: var(--alert-warning-soft);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: var(--alert-warning);
}

.mhc-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mhc-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.mhc-info p {
    font-size: 12px;
    opacity: 0.85;
    margin: 0;
    line-height: 1.4;
}

/* Beaches Alerts */
.beaches-warning-alert {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--alert-danger-soft);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: var(--radius-md);
    margin: 24px;
}

.alert-icon-big {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--alert-danger);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.alert-icon-big i {
    width: 28px;
    height: 28px;
}

.alert-details {
    flex: 1;
}

.alert-details h3 {
    font-size: 18px;
    color: var(--alert-danger);
    margin-bottom: 8px;
}

.alert-details p {
    font-size: 14px;
    margin-bottom: 12px;
}

.alert-details ul {
    list-style-position: inside;
    font-size: 13px;
    color: var(--text-muted);
}

.alert-details li {
    margin-bottom: 6px;
}

/* Warnings stats dashboard */
.warning-stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.w-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-card);
    border-left-width: 4px;
}

.w-stat .num {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
}

.w-stat .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.border-rose { border-left-color: var(--alert-danger); }
.border-amber { border-left-color: var(--alert-warning); }
.border-cyan { border-left-color: var(--accent-primary); }

.warnings-list-detailed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.warning-card-detail {
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.wcd-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.wcd-icon.bg-red { background: var(--alert-danger); }
.wcd-icon.bg-amber { background: var(--alert-warning); }
.wcd-icon.bg-cyan { background: var(--accent-primary); }

.wcd-icon i {
    width: 18px;
    height: 18px;
}

.wcd-content {
    flex: 1;
}

.wcd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.wcd-header h4 {
    font-size: 14px;
    font-weight: 700;
}

.wcd-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.wcd-badge.red { background: var(--alert-danger-soft); color: var(--alert-danger); }
.wcd-badge.amber { background: var(--alert-warning-soft); color: var(--alert-warning); }

.wcd-content p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Raw Telecomm Pre block */
.raw-meteorology-product {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    background: #020408;
    color: #e2e8f0;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: pre-wrap;
    word-break: break-word;
}

[data-theme="light"] .raw-meteorology-product {
    background: #0f172a;
    color: #f1f5f9;
}

/* Copy button & general buttons */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-card);
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--text-muted);
}

.btn-outline i {
    width: 14px;
    height: 14px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-text-link {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-text-link:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

/* Loading indicators */
.loading-state {
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
    font-style: italic;
}

.mobile-footer-actions {
    display: none;
}

/* App Footer */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-top: 1px solid var(--border-card);
    margin-top: auto;
    font-size: 12px;
    color: var(--text-muted);
}

/* Glossary Slide Drawer */
.glossary-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.glossary-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.glossary-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-left: 1px solid var(--border-card);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.glossary-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.drawer-title i {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.drawer-title h3 {
    font-size: 16px;
    font-weight: 700;
}

.close-drawer-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
}

.close-drawer-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.close-drawer-btn i {
    width: 18px;
    height: 18px;
}

.drawer-search {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-card);
}

.drawer-search .search-box {
    width: 100%;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.glossary-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.glossary-card-item {
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 16px;
    transition: all var(--transition-fast);
}

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

.glossary-card-item h4 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 4px;
    cursor: pointer;
    display: inline-block;
}

.glossary-card-item h4:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

.glossary-card-item p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Floating Tooltip Component */
.glossary-tooltip {
    position: absolute;
    width: 280px;
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-card-hover);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    padding: 14px;
    animation: tooltip-show var(--transition-fast) forwards;
}

@keyframes tooltip-show {
    from { opacity: 0; transform: translateY(4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tooltip-header h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--accent-primary);
}

.tooltip-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.tooltip-close:hover {
    color: var(--text-main);
}

.tooltip-close i {
    width: 14px;
    height: 14px;
}

.tooltip-body {
    font-size: 12px;
    color: var(--text-main);
    line-height: 1.5;
    margin-bottom: 10px;
}

.tooltip-footer {
    display: flex;
    justify-content: flex-end;
}

.tooltip-btn-learn-more {
    background: transparent;
    border: none;
    color: var(--accent-secondary);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.tooltip-btn-learn-more:hover {
    color: var(--text-main);
}

.tooltip-btn-learn-more i {
    width: 12px;
    height: 12px;
}

.tooltip-arrow {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-card-hover);
    transform: rotate(45deg);
}

/* Search Term Highlight style */
mark.forecast-highlight {
    background-color: rgba(251, 191, 36, 0.35);
    color: var(--text-main);
    padding: 0 2px;
    border-radius: 2px;
    border-bottom: 1.5px solid var(--alert-warning);
}

/* Key Forecasts Card Section Styles */
.key-forecasts-card {
    position: relative;
    overflow: hidden;
}

.key-forecasts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

.city-forecast-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

[data-theme="light"] .city-forecast-card {
    background: rgba(0, 0, 0, 0.015);
}

.city-forecast-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.city-forecast-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 8px;
}

.city-forecast-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.city-forecast-header .city-coords {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.city-outlook-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.outlook-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 10px 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .outlook-day {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.02);
}

.outlook-day-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.outlook-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.outlook-icon-container i {
    width: 22px;
    height: 22px;
}

.outlook-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.25;
    min-height: 2.5em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.outlook-temp {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
}

.outlook-temp .temp-low {
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 2px;
}

/* Skeletons */
.forecast-skeleton-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.skeleton-city-title {
    height: 16px;
    width: 60%;
    background: linear-gradient(90deg, var(--border-card) 25%, var(--bg-card-hover) 50%, var(--border-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.skeleton-outlook-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.skeleton-day-block {
    height: 84px;
    background: linear-gradient(90deg, var(--border-card) 25%, var(--bg-card-hover) 50%, var(--border-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* Key Forecasts Collapse Transition */
.key-forecasts-card.collapsed #key-forecasts-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    opacity: 0;
}

#key-forecasts-body {
    transition: max-height var(--transition-normal) ease, 
                opacity var(--transition-normal) ease,
                padding var(--transition-normal) ease;
    max-height: 600px;
    opacity: 1;
}

/* Forecast Weather Icon Colors */
.key-forecasts-grid .text-amber {
    color: var(--alert-warning) !important;
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.35));
}
.key-forecasts-grid .text-info {
    color: var(--alert-info) !important;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.35));
}
.key-forecasts-grid .text-danger {
    color: var(--alert-danger) !important;
    filter: drop-shadow(0 0 4px rgba(244, 63, 94, 0.35));
}
.key-forecasts-grid .text-teal {
    color: var(--accent-primary) !important;
    filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.35));
}
.key-forecasts-grid .text-secondary {
    color: var(--accent-secondary) !important;
    filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.3));
}
.key-forecasts-grid .text-primary {
    color: var(--accent-primary) !important;
    filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.3));
}
.key-forecasts-grid .text-muted {
    color: var(--text-muted) !important;
}

/* Current Region Radar Card Styles */
.region-radar-card {
    position: relative;
    overflow: hidden;
}

.radar-glow-icon {
    animation: radar-pulse 2.5s infinite ease-in-out;
}

@keyframes radar-pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; filter: drop-shadow(0 0 1px var(--accent-secondary)); }
    50% { transform: scale(1.12); opacity: 1; filter: drop-shadow(0 0 6px var(--accent-secondary)); }
}

.radar-iframe-container {
    width: 100%;
    height: 480px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-card);
    position: relative;
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .radar-iframe-container {
    background: rgba(0, 0, 0, 0.05);
}

.radar-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

/* Radar Collapse Transition */
.region-radar-card.collapsed #radar-card-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    opacity: 0;
}

#radar-card-body {
    transition: max-height var(--transition-normal) ease, 
                opacity var(--transition-normal) ease,
                padding var(--transition-normal) ease;
    max-height: 600px;
    opacity: 1;
}

/* --- National Outlooks Page --- */
.outlooks-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 2rem;
}

.outlooks-header-card {
    padding: 24px;
}

.outlooks-header-content h3 {
    font-size: 24px;
    font-weight: 800;
    font-family: var(--font-heading);
    margin: 8px 0;
}

.outlooks-header-content p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 800px;
}

.outlooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
}

@media (max-width: 576px) {
    .outlooks-grid {
        grid-template-columns: 1fr;
    }
}

.outlook-card {
    display: flex;
    flex-direction: column;
}

.outlook-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

/* Map Image Styling */
.outlook-image-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-card);
    background: #ffffff; /* Fallback frame background */
    overflow: hidden;
    aspect-ratio: 1.25; /* Approximate aspect ratio of CPC outlook GIFs */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal);
}

.outlook-image-wrapper:hover {
    transform: scale(1.01);
}

[data-theme="dark"] .outlook-image-wrapper {
    background: #f8fafc; /* Keep images crisp, slightly off-white border background */
    border-color: rgba(255, 255, 255, 0.1);
}

.outlook-gif {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.outlook-gif.loaded {
    opacity: 1;
}

/* Hover Zoom Button */
.btn-zoom {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--transition-normal), transform var(--transition-normal), background-color var(--transition-fast);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.outlook-image-wrapper:hover .btn-zoom {
    opacity: 1;
    transform: translateY(0);
}

.btn-zoom:hover {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

/* Skeleton Loading Animation */
.image-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: pulse-skeleton 1.5s infinite;
}

@keyframes pulse-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.outlook-description {
    width: 100%;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.formatted-text-link {
    color: var(--color-link);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.formatted-text-link:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.outlooks-footer {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Lightbox Fullscreen Modal --- */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(7, 11, 19, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lightbox-content-wrapper {
    position: relative;
    width: 90%;
    max-width: 900px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scale-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scale-up {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-card);
}

.lightbox-header h3 {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-heading);
}

.lightbox-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.lightbox-close:hover {
    background: var(--alert-danger-soft);
    color: var(--alert-danger);
}

.lightbox-body {
    padding: 24px;
    background: #ffffff; /* Standard light background for readability of weather maps */
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 80vh;
}

.lightbox-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

/* Tablet & Mobile Responsiveness */
@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
        max-width: 100vw;
        width: 100%;
        overflow-x: hidden;
    }
    
    .sidebar {
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: none;
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    
    .sidebar-brand {
        padding: 16px 20px 8px 20px;
        border-bottom: none;
    }
    
    .sidebar-nav {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--bg-sidebar);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        border-bottom: 1px solid var(--border-card);
        padding: 8px 20px;
        margin: 0;
    }
    
    .sidebar-nav ul {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
        scrollbar-width: none; /* Firefox */
        -webkit-overflow-scrolling: touch; /* Smooth momentum scroll */
    }
    
    .sidebar-nav ul::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .sidebar-nav li {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .nav-item {
        padding: 8px 12px;
        white-space: nowrap;
        font-size: 13px;
    }
    
    .nav-item:hover i {
        transform: none;
    }
    
    .warning-count-badge {
        position: relative;
        right: 0;
        top: 0;
        transform: none;
        margin-left: 6px;
        display: inline-block;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .mobile-region-selector-container {
        display: block;
        margin-top: 16px;
        width: 100%;
    }
    
    .mobile-footer-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        padding: 24px 0;
        border-top: 1px dashed var(--border-card);
        margin-top: 24px;
        margin-bottom: 8px;
        width: 100%;
    }
    
    .mobile-footer-actions .glossary-btn,
    .mobile-footer-actions .theme-toggle-container {
        width: 48%;
    }
    
    .mobile-footer-actions .theme-toggle-btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
        font-weight: 600;
    }
    
    .mobile-footer-actions .glossary-btn {
        padding: 10px 14px;
        font-size: 13px;
        font-weight: 600;
        justify-content: center;
    }
    
    .main-content {
        padding: 0 20px;
        height: auto;
        overflow-y: visible;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .header {
        position: relative;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 0;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box {
        width: 60%;
    }
    
    .key-forecasts-grid {
        grid-template-columns: 1fr;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .span-col-2 {
        grid-column: span 1;
    }
    
    .welcome-card {
        padding: 20px;
    }
    
    .welcome-visual {
        display: none;
    }
    
    .briefing-summary-grid {
        gap: 16px;
    }
    
    .section-layout {
        grid-template-columns: 1fr;
    }
    
    .section-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .raw-meteorology-product {
        white-space: pre-wrap;
        word-break: break-word;
        padding: 16px;
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 14px;
    }
    
    .header-title-area h2 {
        font-size: 20px;
    }
    
    .welcome-card h3 {
        font-size: 22px;
    }
    
    .card-body, .formatted-text {
        padding: 16px;
    }
    
    .card-header, .card-header-main {
        padding: 14px 16px;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .alert-status-badge {
        justify-content: center;
    }
    
    .quick-highlights {
        flex-direction: column;
        gap: 12px;
    }
    
    .marine-hazard-grid {
        grid-template-columns: 1fr;
        margin: 10px 0;
    }
    
    .beaches-warning-alert {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin: 10px 0;
        padding: 16px;
    }
    
    .warning-stats-summary {
        grid-template-columns: 1fr;
    }
    
    .w-stat {
        padding: 12px;
    }
    
    .w-stat .num {
        font-size: 24px;
    }
    
    .glossary-drawer {
        width: 100%;
    }
    
    .app-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 20px 0;
    }
}
