:root {
    --primary: #FFFFFF;
    --accent: #34C759;
    /* Green for safe/live */
    --danger: #FF3B30;
    --warning: #FF9500;
    --background: #000000;
    --surface: rgba(30, 30, 30, 0.6);
    --surface-hover: rgba(50, 50, 50, 0.8);
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --radius: 24px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    /* Prevent text selection on mobile for better UX */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Allow text selection in input fields and text areas */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

body.auth-page {
    overflow: auto;
}

.hidden {
    display: none !important;
}

/* Glassmorphism */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

/* App Layout */
.dashboard-container {
    display: grid;
    grid-template-rows: 80px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Top Navigation */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 100;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-sub {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 16px;
    background: #3a3a3c;
    /* Dark grey pill */
    padding: 8px 20px;
    border-radius: 30px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.badge {
    display: none; /* Hidden - using colored icons instead */
}

.nav-btn[title="Notifications"] i {
    transition: color 0.3s ease;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #555;
    background-image: url('https://ui-avatars.com/api/?name=Admin&background=random');
    background-size: cover;
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px 12px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    color: var(--text-primary);
}

.logout-btn:active {
    opacity: 0.8;
}

/* Main Content Area */
.main-content {
    position: relative;
    padding: 20px 40px;
    height: calc(100vh - 80px);
    /* Adjust for header */
}

.view-section {
    display: none;
    height: 100%;
}

.view-section.active {
    display: grid;
    grid-template-columns: 1fr 350px;
    /* Map area | Widgets */
    gap: 30px;
    position: relative;
}

/* Map Section */
.map-section {
    position: relative;
    border-radius: var(--radius);
    height: 100%;
}

#map-container {
    width: 100%;
}

/* Map Coming Soon Message */
.map-coming-soon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
    z-index: 10;
    pointer-events: none;
}

.map-coming-soon i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
    display: block;
}

.map-coming-soon h2 {
    font-size: 1.5rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    letter-spacing: 2px;
}

/* Location Overlay on Map */
.location-info {
    position: absolute;
    top: 20px;
    /* Reduced from 40px to align with right-side widgets */
    left: 40px;
    z-index: 500;
}

.weather-large h1 {
    font-size: 4rem;
    font-weight: 300;
    margin: 0;
}

.weather-large p {
    color: var(--text-secondary);
    margin: 5px 0 20px 0;
}

.risk-alert {
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid var(--danger);
    color: #ffbaba;
    padding: 12px 20px;
    border-radius: 12px;
    max-width: 400px;
    margin-bottom: 20px;
}

.temp-display {
    font-size: 5rem;
    font-weight: 200;
}

.temp-unit {
    font-size: 5rem;
    color: var(--text-secondary);
    vertical-align: baseline;
}

.location-marker {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* AI Prediction Header Area */
.ai-prediction-header-area {
    margin-top: 12px;
    padding: 0;
    background: transparent;
    border: none;
    min-height: auto;
}

.ai-prediction-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 8px;
}

.ai-prediction-loading i {
    font-size: 0.9rem;
    color: #007AFF;
}

.ai-prediction-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.ai-prediction-header > div:first-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.ai-prediction-header i {
    color: #007AFF;
    font-size: 0.85rem;
}

.ai-prediction-label {
    font-weight: 500;
}

.ai-prediction-confidence {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-left: 4px;
}

.ai-prediction-risk {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
}

.risk-level {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-level.low {
    color: #34C759;
}

.risk-level.medium {
    color: #FFCC00;
}

.risk-level.high {
    color: #FF9500;
}

.risk-level.critical {
    color: #FF3B30;
    animation: pulse 2s infinite;
}

.ai-prediction-summary-inline {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 4px;
    opacity: 0.9;
}

.ai-prediction-unavailable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 8px;
}

.ai-prediction-unavailable i {
    font-size: 0.85rem;
}

/* Widgets Column */
.widgets-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.wind-graph {
    height: 80px;
    width: 100%;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sunrise-slider {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    margin: 30px 0;
    border-radius: 2px;
}

.sun-knob {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    top: -4px;
    left: 40%;
    /* Demo position */
    box-shadow: 0 0 10px #fff;
}

.time-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Bottom Timeline */
.timeline-section {
    position: absolute;
    bottom: 180px;
    /* Moved up to make room for river wave */
    left: 40px;
    right: 40px;
    /* Spans full width of the parent (view-section or map-section) */
    z-index: 500;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* River Level Wave (Bottom) */
.river-level-wave {
    position: absolute;
    bottom: 0;
    left: -40px;
    /* Extend to screen edge */
    right: -40px;
    /* Extend to screen edge */
    width: auto;
    height: 180px;
    /* Constrained to not exceed weather cards section */
    max-height: 180px;
    padding-bottom: 40px;
    /* Add padding at bottom so x-axis and labels are visible */
    z-index: 100;
    opacity: 0.9;
    pointer-events: none;
    overflow: visible;
    /* Changed to visible so bottom labels can be seen */
}

/* Mobile: Remove absolute positioning to prevent overlap */
@media screen and (max-width: 768px) {
    .timeline-section {
        position: relative !important;
        bottom: auto !important;
        left: 0 !important;
        right: 0 !important;
        order: 3;
        margin-top: 16px;
        margin-bottom: 0;
        padding: 0 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .river-level-wave {
        position: relative !important;
        bottom: auto !important;
        left: 0 !important;
        right: 0 !important;
        order: 4;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }
}

/* Desktop: Hide mobile-only elements */
@media screen and (min-width: 769px) {
    /* Bottom navigation - hidden on desktop */
    .bottom-nav {
        display: none !important;
    }
    
    /* Pull to refresh - hidden on desktop */
    .pull-to-refresh {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* River level title - hidden on desktop */
    .river-level-title {
        display: none !important;
    }
}

.forecast-day {
    text-align: center;
    padding: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
}

/* --- OVERLAYS & MODALS --- */

/* Utility: Hidden Class */
.hidden {
    display: none !important;
}

/* Full Screen Overlay (Search) */
.overlay-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.search-container {
    position: relative;
    width: 60%;
    max-width: 800px;
}

/* Input wrapper to contain icons */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 10;
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 2.5rem;
    color: white;
    padding: 10px 50px 10px 50px;
    outline: none;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.close-overlay {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 1.2rem;
    z-index: 10;
    opacity: 1 !important;
    visibility: visible !important;
}

.close-overlay:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.close-overlay i {
    display: block !important;
}

/* Search Results */
.search-results {
    margin-top: 50px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 10px;
    position: relative;
    z-index: 1;
}

/* Custom Scrollbar Styling */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar */
.search-results {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

.search-results.hidden {
    display: none;
}

/* Custom Scrollbar Styling - Thin and matching app theme */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar */
.search-results {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

.results-section {
    margin-bottom: 30px;
}

.results-header {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.result-item.existing {
    border-left: 3px solid #007AFF;
}

.result-item.external {
    border-left: 3px solid #34C759;
}

.result-info {
    flex: 1;
}

.result-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.result-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    gap: 15px;
    align-items: center;
}

.result-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.result-type.weather {
    background: rgba(0, 122, 255, 0.2);
    color: #007AFF;
}

.result-type.river {
    background: rgba(52, 199, 89, 0.2);
    color: #34C759;
}

.result-action {
    padding: 8px 20px;
    background: rgba(0, 122, 255, 0.2);
    border: 1px solid rgba(0, 122, 255, 0.3);
    border-radius: 8px;
    color: #007AFF;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.result-action:hover {
    background: rgba(0, 122, 255, 0.3);
    border-color: rgba(0, 122, 255, 0.5);
}

.result-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.result-action.added {
    background: rgba(52, 199, 89, 0.2);
    border-color: rgba(52, 199, 89, 0.3);
    color: #34C759;
    cursor: default;
}

.result-action.added::before {
    content: "✓ ";
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 1rem;
}
    font-weight: 300;
}

.search-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.close-overlay {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
    cursor: pointer;
}

/* Floating Window (Map) */
.floating-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zoomIn 0.3s ease;
}

.window-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.window-body {
    flex: 1;
    position: relative;
}

/* Notification Panel (Center) */
.notification-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90vw;
    max-height: calc(100vh - 100px);
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    z-index: 1400;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.close-panel {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 1rem;
}

.close-panel:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.notification-list {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.notif-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notif-item.critical .notif-icon {
    background: rgba(255, 59, 48, 0.2);
    color: #FF3B30;
}

.notif-item.warning .notif-icon {
    background: rgba(255, 204, 0, 0.2);
    color: #FFCC00;
}

.notif-item.info .notif-icon {
    background: rgba(10, 132, 255, 0.2);
    color: #0A84FF;
}

.notif-content h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    font-weight: 500;
}

.notif-content p {
    margin: 0 0 5px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.notif-content .time {
    font-size: 0.75rem;
    color: #666;
}

/* Empty State */
.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.notification-empty i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.notification-empty p {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}

.notification-empty .empty-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Notification Empty State */
.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.notification-empty i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.notification-empty p {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0 0 10px 0;
    color: var(--text-primary);
}

.notification-empty .empty-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.forecast-day.active {
    background: var(--surface-hover);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.day-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.day-temp {
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

/* ============================================
   AUTHENTICATION PAGES
   ============================================ */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
    background: var(--background);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    animation: pulse 20s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    max-height: 95vh;
    padding: 32px 36px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    box-sizing: border-box;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header .logo-section {
    justify-content: center;
    margin-bottom: 16px;
}

.auth-header .logo-section .logo-icon {
    font-size: 1.2rem;
}

.auth-header .logo-section .brand-name {
    font-size: 1rem;
}

.auth-header .logo-section .brand-sub {
    font-size: 0.65rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--text-primary);
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label i {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.form-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-group input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-group input:hover:not(:focus) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-top: -4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--text-primary);
}

.forgot-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.forgot-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.auth-button {
    background: var(--text-primary);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    color: var(--background);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: 4px;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
    opacity: 0.9;
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button i {
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.auth-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.auth-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.alert {
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.alert-error {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.alert-info {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.alert i {
    font-size: 0.9rem;
}

/* Hide scrollbar for auth card but allow scrolling if needed */
.auth-card::-webkit-scrollbar {
    width: 4px;
}

.auth-card::-webkit-scrollbar-track {
    background: transparent;
}

.auth-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.auth-card::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Custom Confirmation Dialog */
.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.confirm-dialog {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: zoomInDialog 0.3s ease;
    overflow: hidden;
}

@keyframes zoomInDialog {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.confirm-dialog-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.confirm-dialog-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.confirm-dialog-body {
    padding: 30px 20px;
}

.confirm-dialog-body p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.confirm-dialog-footer {
    padding: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.confirm-btn-ok,
.confirm-btn-cancel {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.confirm-btn-ok {
    background: rgba(0, 122, 255, 0.2);
    border: 1px solid rgba(0, 122, 255, 0.4);
    color: #007AFF;
}

.confirm-btn-ok:hover {
    background: rgba(0, 122, 255, 0.3);
    border-color: rgba(0, 122, 255, 0.5);
    transform: translateY(-1px);
}

.confirm-btn-ok:active {
    transform: translateY(0);
}

.confirm-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.confirm-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.confirm-btn-cancel:active {
    transform: translateY(0);
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

/* Tablet: 768px - 1024px */
@media screen and (max-width: 1024px) {
    .main-content {
        padding: 20px;
    }
    
    .view-section.active {
        gap: 20px;
    }
    
    .widgets-column {
        gap: 15px;
    }
    
    .search-container {
        width: 80%;
    }
}

/* Mobile: < 768px */
@media screen and (max-width: 768px) {
    /* Base Layout Adjustments */
    body {
        overflow-x: hidden;
    }
    
    .dashboard-container {
        grid-template-rows: 70px 1fr;
    }
    
    /* Header - Mobile Optimized */
    .app-header {
        padding: 0 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .logo-section {
        gap: 8px;
    }
    
    .logo-icon {
        font-size: 1.2rem;
    }
    
    .brand-name {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }
    
    .brand-sub {
        display: none; /* Hide subtitle on mobile */
    }
    
    .nav-links {
        padding: 6px 12px;
        gap: 8px;
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }
    
    .nav-btn {
        padding: 10px;
        font-size: 1rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .user-profile {
        gap: 8px;
        order: 2;
    }
    
    .user-info {
        display: none; /* Hide user info text on mobile */
    }
    
    .avatar {
        width: 36px;
        height: 36px;
    }
    
    .logout-btn {
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Main Content - Stack Vertically */
    .main-content {
        padding: 16px;
        height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .view-section.active {
        display: flex;
        flex-direction: column;
        gap: 16px;
        height: auto;
        min-height: 100%;
        position: relative;
    }
    
    .map-section {
        order: 1;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        border-radius: 16px;
        position: relative !important;
        margin-bottom: 16px !important;
        overflow: visible !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .widgets-column {
        order: 2;
        gap: 12px;
        display: flex;
        flex-direction: column;
        width: 100%;
        position: relative;
        margin-bottom: 16px;
    }
    
    .widget-card {
        padding: 16px;
        margin-bottom: 0;
        width: 100%;
        position: relative;
        box-sizing: border-box;
        flex-shrink: 0;
    }
    
    /* Ensure location-info flows naturally and doesn't overlap */
    .map-section .location-info {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 16px !important;
        width: calc(100% - 32px) !important;
        max-width: none !important;
        box-sizing: border-box !important;
        z-index: auto !important;
        transform: none !important;
    }
    
    /* Override any other location-info styles on mobile */
    .location-info {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }
    
    .widget-header {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    
    /* Location Info Overlay - Mobile */
    /* Location Info - Mobile: Force relative positioning to prevent overlap */
    .location-info {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        max-width: none !important;
        margin: 16px !important;
        margin-bottom: 16px !important;
        width: calc(100% - 32px) !important;
        box-sizing: border-box !important;
        z-index: auto !important;
        transform: none !important;
    }
    
    /* Ensure map-section contains location-info properly */
    .map-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .weather-large h1 {
        font-size: 2rem;
        font-weight: 400;
    }
    
    .weather-large p {
        font-size: 0.9rem;
        margin: 4px 0 12px 0;
    }
    
    .temp-display {
        font-size: 3rem;
        font-weight: 200;
    }
    
    .temp-unit {
        font-size: 3rem;
    }
    
    .location-marker {
        font-size: 0.75rem;
        margin-top: 8px;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .location-marker span {
        font-size: 0.7rem;
        padding: 3px 8px;
        margin-left: 0;
    }
    
    .risk-alert {
        padding: 10px 16px;
        font-size: 0.85rem;
        max-width: 100%;
        margin-bottom: 12px;
    }
    
    /* Timeline Section - Mobile */
    .timeline-section {
        position: relative;
        bottom: auto;
        left: 0;
        right: 0;
        order: 3;
        margin-top: 16px;
        padding: 0 16px;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        justify-content: flex-start;
        gap: 12px;
    }
    
    .timeline-section::-webkit-scrollbar {
        height: 4px;
    }
    
    .timeline-section::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .timeline-section::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }
    
    .forecast-day {
        min-width: 80px;
        padding: 8px;
        flex-shrink: 0;
    }
    
    .day-name {
        font-size: 0.65rem;
    }
    
    .day-temp {
        font-size: 1rem;
    }
    
    /* River Wave - Mobile */
    .river-level-wave {
        position: relative;
        bottom: auto;
        left: 0;
        right: 0;
        order: 4;
        height: 200px;
        min-height: 200px;
        padding: 20px 0 30px 0;
        margin-top: 24px;
        margin-bottom: calc(140px + env(safe-area-inset-bottom)); /* Increased margin from bottom navbar */
        width: 100%;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scroll-behavior: smooth;
        /* Ensure scrolling works */
        touch-action: pan-x;
    }
    
    /* Scrollbar styling for river level */
    .river-level-wave::-webkit-scrollbar {
        height: 4px;
    }
    
    .river-level-wave::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 2px;
    }
    
    .river-level-wave::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }
    
    /* SVG Container for scrolling */
    .river-level-svg-container {
        position: relative;
        width: 1440px;
        min-width: 1440px;
        height: calc(100% - 40px);
        margin-top: 20px;
    }
    
    .river-level-wave svg,
    .river-level-wave .river-level-svg {
        position: relative !important; /* Change from absolute to relative for scrolling */
        top: auto !important;
        left: auto !important;
        width: 1440px !important; /* Fixed width to enable horizontal scrolling */
        min-width: 1440px !important;
        height: calc(100% - 20px) !important;
        overflow: visible;
        display: block;
    }
    
    /* Ensure the container can scroll */
    .river-level-wave {
        display: block;
        pointer-events: auto; /* Enable touch events for scrolling */
    }
    
    .river-level-title {
        pointer-events: none; /* Title doesn't interfere with scrolling */
        position: relative;
        z-index: 10;
        padding: 0 16px;
    }
    
    /* Improve text readability on mobile */
    .river-level-wave text {
        font-size: 12px !important;
        font-weight: 600 !important;
        fill: #FFFFFF !important;
        opacity: 1 !important;
    }
    
    /* Larger dots for better visibility and touch */
    .river-level-wave circle {
        r: 8px !important;
        stroke-width: 2px !important;
    }
    
    /* Active dot (Tuesday) - more prominent */
    .river-level-wave circle[id*="wave-dot-3"] {
        r: 10px !important;
        stroke-width: 3px !important;
        filter: drop-shadow(0 0 8px rgba(0, 122, 255, 0.6));
    }
    
    /* Active label - larger and more visible */
    .river-level-wave text[id="wave-label-active"] {
        font-size: 16px !important;
        font-weight: 700 !important;
        fill: #007AFF !important;
        opacity: 1 !important;
    }
    
    /* Hide debug axes on mobile for cleaner look */
    .river-level-wave #wave-axes {
        opacity: 0.2;
    }
    
    /* Better wave path visibility - Enhanced for clarity */
    .river-level-wave #river-wave-path {
        fill: none !important;
        stroke: #FFFFFF !important;
        stroke-opacity: 1 !important;
        stroke-width: 3px !important;
        stroke-linecap: round !important;
        stroke-linejoin: round !important;
    }
    
    /* Ensure dots are visible */
    .river-level-wave circle {
        opacity: 1 !important;
        stroke-width: 2px !important;
    }
    
    /* Active dot (Tuesday) - very visible */
    .river-level-wave circle[id*="wave-dot-3"] {
        opacity: 1 !important;
        fill: #FFFFFF !important;
        stroke: #007AFF !important;
        stroke-width: 3px !important;
        filter: drop-shadow(0 0 8px rgba(0, 122, 255, 0.8)) !important;
    }
    
    /* Ensure text labels are visible */
    .river-level-wave text {
        opacity: 1 !important;
        fill: #FFFFFF !important;
        font-weight: 700 !important;
    }
    
    .river-level-wave text[id="wave-label-active"] {
        opacity: 1 !important;
        fill: #007AFF !important;
        font-weight: 700 !important;
        font-size: 16px !important;
    }
    
    /* Wind Graph - Mobile */
    .wind-graph {
        height: 60px;
    }
    
    .sunrise-slider {
        margin: 20px 0;
    }
    
    .time-labels {
        font-size: 0.7rem;
    }
    
    /* Search Overlay - Mobile Full Screen */
    .overlay-fullscreen {
        padding: 0;
    }
    
    .search-container {
        width: 100%;
        max-width: 100%;
        padding: 20px 16px;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .search-input-wrapper {
        margin-bottom: 20px;
    }
    
    .search-icon {
        font-size: 1.5rem;
        left: 0;
    }
    
    .search-input {
        font-size: 1.5rem;
        padding: 12px 50px 12px 40px;
    }
    
    .close-overlay {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
    
    .search-results {
        flex: 1;
        margin-top: 20px;
        max-height: calc(100vh - 150px);
        overflow-y: auto;
    }
    
    .results-header {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .result-item {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .result-name {
        font-size: 1rem;
    }
    
    .result-details {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    .result-action {
        width: 100%;
        padding: 10px;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    /* Map Overlay - Mobile Full Screen */
    .floating-window {
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
        max-width: 100%;
        max-height: 100%;
    }
    
    .window-header {
        padding: 12px 16px;
    }
    
    .window-header span {
        font-size: 1rem;
    }
    
    .close-window {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    /* Notification Panel - Mobile Full Screen */
    .notification-panel {
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
        max-width: 100%;
        max-height: 100%;
    }
    
    .panel-header {
        padding: 16px;
    }
    
    .panel-header h3 {
        font-size: 1.1rem;
    }
    
    .close-panel {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .notification-list {
        padding: 16px;
    }
    
    .notif-item {
        padding: 12px 0;
        gap: 12px;
    }
    
    .notif-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .notif-content h4 {
        font-size: 0.95rem;
    }
    
    .notif-content p {
        font-size: 0.8rem;
    }
    
    .notif-content .time {
        font-size: 0.7rem;
    }
    
    /* Confirmation Dialog - Mobile */
    .confirm-dialog {
        width: 90vw;
        max-width: 90vw;
        margin: 20px;
    }
    
    .confirm-dialog-header {
        padding: 16px;
    }
    
    .confirm-dialog-header h3 {
        font-size: 1.1rem;
    }
    
    .confirm-dialog-body {
        padding: 24px 16px;
    }
    
    .confirm-dialog-body p {
        font-size: 0.95rem;
    }
    
    .confirm-dialog-footer {
        padding: 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .confirm-btn-ok,
    .confirm-btn-cancel {
        width: 100%;
        padding: 12px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    /* Auth Pages - Mobile */
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 24px 20px;
        max-width: 100%;
    }
    
    .auth-header .logo-section .logo-icon {
        font-size: 1rem;
    }
    
    .auth-header .logo-section .brand-name {
        font-size: 0.9rem;
    }
    
    .auth-header .logo-section .brand-sub {
        font-size: 0.6rem;
    }
    
    .auth-subtitle {
        font-size: 0.8rem;
    }
    
    .form-group input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .auth-button {
        padding: 14px 20px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    /* View Map Section - Mobile */
    #view-map .map-section {
        height: 100%;
        min-height: 100%;
    }
    
    /* Utility Adjustments */
    .glass-panel {
        border-radius: 16px;
    }
    
    /* Ensure no horizontal overflow */
    * {
        max-width: 100%;
    }
    
    img, svg {
        max-width: 100%;
        height: auto;
    }
}

/* Small Mobile: < 480px */
@media screen and (max-width: 480px) {
    .app-header {
        padding: 0 12px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .map-section {
        height: 250px;
        min-height: 250px;
    }
    
    .weather-large h1 {
        font-size: 1.5rem;
    }
    
    .temp-display {
        font-size: 2.5rem;
    }
    
    .temp-unit {
        font-size: 2.5rem;
    }
    
    .location-info {
        top: 12px;
        left: 12px;
        right: 12px;
    }
    
    .widget-card {
        padding: 12px;
    }
    
    .forecast-day {
        min-width: 70px;
        padding: 6px;
    }
    
    .river-level-wave {
        height: 160px;
        min-height: 160px;
        padding: 16px 12px 20px;
    }
    
    /* Smaller text on very small screens */
    .river-level-wave text {
        font-size: 11px !important;
    }
    
    .river-level-wave text[id="wave-label-active"] {
        font-size: 14px !important;
    }
    
    .river-level-wave circle {
        r: 7px !important;
    }
    
    .river-level-wave circle[id*="wave-dot-3"] {
        r: 9px !important;
    }
    
    .search-input {
        font-size: 1.2rem;
    }
    
    .auth-card {
        padding: 20px 16px;
    }
}

/* Landscape Mobile: < 768px and landscape */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .map-section {
        height: 200px;
        min-height: 200px;
    }
    
    .river-level-wave {
        height: 140px;
        min-height: 140px;
        padding: 12px 8px 16px;
    }
    
    /* Compact text in landscape */
    .river-level-wave text {
        font-size: 10px !important;
    }
    
    .river-level-wave text[id="wave-label-active"] {
        font-size: 13px !important;
    }
    
    .main-content {
        padding: 12px;
    }
}

/* ============================================
   ENHANCED MOBILE UX IMPROVEMENTS
   ============================================ */

/* Bottom Navigation Bar (Mobile Only) */
.bottom-nav {
    display: none; /* Hidden on desktop by default */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    visibility: hidden; /* Ensure hidden on desktop */
    opacity: 0; /* Ensure hidden on desktop */
}

.bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 8px 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 60px;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-btn i {
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.bottom-nav-btn span:not(.bottom-nav-badge) {
    font-size: 0.65rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.bottom-nav-btn.active {
    color: var(--text-primary);
}

.bottom-nav-btn.active i {
    transform: scale(1.1);
    color: #007AFF;
}

.bottom-nav-btn:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: 20%;
    background: #FF3B30;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Show bottom nav on mobile */
@media screen and (max-width: 768px) {
    .bottom-nav {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Show river level title on mobile */
    .river-level-title {
        display: block !important;
    }
    
    /* Enable pull-to-refresh on mobile */
    .pull-to-refresh {
        visibility: visible;
    }
    
    /* Hide top nav buttons on mobile, keep logo */
    .nav-links {
        display: none;
    }
    
    /* Adjust main content padding for bottom nav */
    .main-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
    
    .dashboard-container {
        grid-template-rows: 60px 1fr;
    }
    
    /* Reduce header height on mobile */
    .app-header {
        height: 60px;
        padding: 0 16px;
    }
    
    /* Better card elevation and spacing */
    .widget-card {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.08);
        transition: all 0.3s ease;
        margin-bottom: 12px;
    }
    
    .widget-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    /* Enhanced location info card - Consolidated mobile styles */
    .location-info {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        background: rgba(30, 30, 30, 0.85) !important;
        backdrop-filter: blur(20px) !important;
        padding: 16px !important;
        border-radius: 16px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
        margin: 16px !important;
        margin-bottom: 16px !important;
        width: calc(100% - 32px) !important;
        max-width: none !important;
        box-sizing: border-box !important;
        z-index: auto !important;
        transform: none !important;
    }
    
    /* Better timeline cards */
    .forecast-day {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.2s ease;
        cursor: pointer;
    }
    
    .forecast-day:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.1);
    }
    
    .forecast-day.active {
        background: rgba(0, 122, 255, 0.2);
        border-color: rgba(0, 122, 255, 0.4);
        box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
    }
    
    /* Improved touch feedback */
    button, .nav-btn, .result-item, .notif-item {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
        transition: all 0.2s ease;
    }
    
    button:active, .nav-btn:active, .result-item:active {
        transform: scale(0.97);
        opacity: 0.8;
    }
    
    /* Better spacing for readability */
    .weather-large {
        margin-bottom: 16px;
    }
    
    .weather-large h1 {
        margin-bottom: 8px;
        line-height: 1.2;
    }
    
    .temp-display {
        margin: 12px 0;
        line-height: 1;
    }
    
    /* Enhanced widget headers */
    .widget-header {
        padding-bottom: 12px;
        margin-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Better river wave visibility - Enhanced */
    .river-level-wave {
        background: rgba(0, 0, 0, 0.5);
        border-radius: 16px;
        padding: 20px 16px 30px;
        margin-top: 24px;
        margin-bottom: 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.15);
        position: relative;
        width: 100%;
        box-sizing: border-box;
        min-height: 200px;
    }
    
    .river-level-title {
        display: block !important;
        font-size: 1rem;
        font-weight: 600;
        color: #FFFFFF;
        margin-bottom: 12px;
        opacity: 1;
    }
    
    /* Title/label for river level section - Mobile only */
    .river-level-title {
        display: none; /* Hidden by default (desktop) */
    }
    
    /* Improved search results */
    .result-item {
        border-radius: 12px;
        margin-bottom: 8px;
        transition: all 0.2s ease;
    }
    
    .result-item:active {
        transform: translateX(4px);
        background: rgba(255, 255, 255, 0.1);
    }
    
    /* Better notification items */
    .notif-item {
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 8px;
        background: rgba(255, 255, 255, 0.03);
        transition: all 0.2s ease;
    }
    
    .notif-item:active {
        transform: scale(0.98);
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Pull to Refresh (Mobile Only) */
.pull-to-refresh {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Hidden by default (desktop) */
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 0 0 20px 20px;
    z-index: 999;
    transition: top 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    visibility: hidden; /* Ensure hidden on desktop */
}

.pull-to-refresh.show {
    top: 0;
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

/* Hide text completely */
.pull-to-refresh-text {
    display: none !important;
}

.pull-to-refresh-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.2);
    color: #007AFF;
    animation: spin 1s linear infinite;
}

.pull-to-refresh.show .pull-to-refresh-icon {
    animation: spin 1s linear infinite;
}

.pull-to-refresh-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
}

/* Safe Area Support (for notches) */
@supports (padding: max(0px)) {
    .dashboard-container {
        padding-top: env(safe-area-inset-top);
    }
    
    .main-content {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    
    .bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Enhanced Visual Hierarchy */
@media screen and (max-width: 768px) {
    /* Better section spacing */
    .view-section.active {
        gap: 20px;
    }
    
    /* Improved card grouping */
    .widgets-column {
        gap: 16px;
    }
    
    /* Better text contrast */
    .location-name {
        font-weight: 500;
        opacity: 0.9;
    }
    
    /* Enhanced temperature display */
    .temp-display {
        font-weight: 200;
        letter-spacing: -2px;
    }
    
    /* Better icon sizing */
    .widget-header i {
        font-size: 1rem;
        margin-right: 8px;
    }
    
    /* Improved timeline spacing */
    .timeline-section {
        padding: 12px 0;
        margin: 16px 0;
    }
    
    /* Better wave visualization container */
    .river-level-wave {
        margin-top: 24px;
        padding-top: 16px;
    }
}

/* Small Mobile Enhancements */
@media screen and (max-width: 480px) {
    .bottom-nav-btn {
        min-height: 56px;
        padding: 6px 2px;
    }
    
    .bottom-nav-btn i {
        font-size: 1.1rem;
    }
    
    .bottom-nav-btn span:not(.bottom-nav-badge) {
        font-size: 0.6rem;
    }
    
    .widget-card {
        padding: 14px;
    }
    
    .location-info {
        padding: 14px;
    }
}