:root {
    --bg-dark: #0f1012;
    --panel-dark: #1a1c1e;
    --accent-red: #e63946;
    --accent-orange: #f4a261;
    --accent-yellow: #e9c46a;
    --text-main: #f8f9fa;
    --text-muted: #adb5bd;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --safe-bottom: env(safe-area-inset-bottom);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header Styling */
.main-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-dark);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.logo-container {
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.logo-red {
    color: var(--accent-red);
}

.subtitle {
    font-size: 0.5rem;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subtitle a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
}

.subtitle a:hover {
    text-decoration: underline;
}

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

.btn-notify {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--accent-red);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    background: var(--accent-red);
    color: white;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.2);
}

.btn-notify:hover {
    background: #ff4d5a;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(230, 57, 70, 0.3);
}

.btn-notify:active {
    transform: scale(0.96);
}

/* Map Styling */
#app-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#map-container {
    flex: 1;
    position: relative;
    height: 100%;
}

#map {
    height: 100%;
    width: 100%;
}

/* Leaflet Dark Mode Adjustment */
.leaflet-container {
    background: #111 !important;
}

.leaflet-tile-pane {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Slide Panel Styling */
.slide-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40vh;
    background: var(--panel-dark);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(60px + var(--safe-bottom));
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-handle {
    width: 40px;
    height: 4px;
    background: var(--glass-border);
    border-radius: 2px;
    margin: 12px auto;
}

.panel-header {
    padding: 0 1.5rem 1rem;
}

.panel-header h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#last-update {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Alert List Styling */
.alert-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem;
}

.alert-item {
    background: var(--glass);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--glass-border);
}

.alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.alert-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 4px;
    display: block;
}

.alert-content h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.alert-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.type-weather {
    background: rgba(233, 196, 106, 0.1);
    color: var(--accent-yellow);
}

.type-road {
    background: rgba(244, 162, 97, 0.1);
    color: var(--accent-orange);
}

.type-danger {
    background: rgba(230, 57, 70, 0.1);
    color: var(--accent-red);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + var(--safe-bottom));
    background: rgba(26, 28, 30, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-bottom);
    border-top: 1px solid var(--glass-border);
    z-index: 2000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    gap: 4px;
    transition: color 0.2s;
    text-decoration: none;
}

.nav-item.active {
    color: var(--accent-red);
}

.panel-expanded {
    height: 85vh;
}

/* Install Banner - Bottom Premium Popup */
.install-banner {
    position: fixed;
    bottom: calc(75px + var(--safe-bottom));
    left: 12px;
    right: 12px;
    background: var(--panel-dark);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    z-index: 3000;
    animation: slideUpBanner 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.banner-text h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.banner-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-banner-primary {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-banner-close {
    background: var(--glass);
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

@keyframes slideUpBanner {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Styling - Manual Instructions */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    padding: 20px;
}

.modal-content {
    background: var(--panel-dark);
    border-radius: 24px;
    width: 100%;
    max-width: 360px;
    padding: 24px;
    border: 1px solid var(--glass-border);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.close-btn {
    background: var(--glass);
    border: none;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-body p {
    margin-bottom: 16px;
    line-height: 1.6;
}

@keyframes modalPop {
    from {
        transform: scale(0.9) translateY(30px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}