/* === RESET === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #d7e6f2;
    color: #000;
    font-size: 12px;
    width: 1024px;
    height: 998px;
    margin: 0 auto;
    border: 1px solid #9fb6cc;
}

/* === TOPBAR === */
.topbar {
    background: linear-gradient(90deg, rgba(0,111,255,1) 0%, rgba(255,255,255,1) 80%);
    border: 1px solid #9fb6cc;
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 24px;
    font-size: 12px;
}

.topbar .left {
    color: #ffffff;
    font-weight: bold;
}

.topbar .right {
    color: #000000;
}

/* === NAV BAR === */
.navbar {
    background: #e9f1f8;
    border-bottom: 1px solid #9fb6cc;
    font-size: 11px;
    height: 24px;
    display: flex;
    align-items: stretch;
    padding: 0 6px;
}

.navbar span {
    margin-right: 6px;
    color: #003366;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 6px;
}

.navbar span:hover {
    background: #8fb1d4;
    color: #ffffff;
}

/* === MAIN LAYOUT === */
.container {
    display: grid;
    grid-template-columns: 190px 1fr 320px;
    flex: 1; /* take remaining vertical space */
    overflow: hidden; /* panels scroll individually */
}

/* === LEFT SIDEBAR === */
.sidebar {
    background: #cfe0f1;
    border-right: 1px solid #9fb6cc;
    padding: 1px 6px 6px; /* 3px extra space at the top */
    overflow-y: auto;
}

.menu-title {
    background: #8fb1d4;
    padding: 3px 6px;
    margin: 6px 0 4px;
    font-weight: bold;
    color: #003366;
}

.menu-item {
    display: block;
    padding: 2px 10px;
    cursor: pointer;
    text-decoration: none;
    color: #003366;
}

.menu-item:hover {
    background: #b6d0ea;
    color: #003366;
}

/* === CENTER PANEL === */
.main {
    background: #fff;
    border-right: 1px solid #9fb6cc;
    padding: 6px;
    overflow-y: auto; /* scrollable if content too tall */
    height: 948px;
}

hr {
    width: 95%;
    margin: auto;
    border: 1px solid #9fb6cc;
}

/* TABLE STYLES */
.weather-table, .grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
}

.weather-table th,
.weather-table td,
.grid-table td {
    flex: 1 1 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}


.weather-table th {
    background: #b6d0ea;
    font-weight: bold;
}

.weather-table tbody tr:nth-child(even) {
    background: #f5f9ff;
}

.weather-table tbody tr:hover {
    background: #dce8f6;
}

/* GRID TABLE FLEX WRAP */
.grid-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.grid-table td {
    flex: 1 1 100px;
}

/* === RIGHT PANEL === */
.right-panel {
    background: #dbeaf6;
    padding: 6px;
    overflow-y: auto; /* scrollable */
}

.panel-box {
    border: 1px solid #9fb6cc;
    background: #eaf2fb;
    margin-bottom: 8px;
}

.panel-title {
    background: #8fb1d4;
    padding: 3px 6px;
    font-weight: bold;
    color: #003366;
}

.panel-content {
    padding: 6px;
    max-height: 900px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

img.refresh {
    cursor: pointer;
}
/* === MAP PLACEHOLDER === */
.map {
    height: 180px;
    background: #fff;
    border: 1px solid #9fb6cc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-style: italic;
}

/* === FOOTER === */
.footer {
    background: linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(0,111,255,1) 80%);
    border: 1px solid #9fb6cc;
    padding: 4px 8px;
    height: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    flex-shrink: 0; /* keep footer at bottom */
}

.footer .left {
    color: #003366;
}

.footer .right {
    color: #ffffff;
    font-weight: bold;
}

/* === CUSTOM SCROLLBAR WITHOUT ROUNDED CORNERS === */
.panel-content,
.main,
.right-panel,
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: #8fb1d4 #eaf2fb;
}

.panel-content::-webkit-scrollbar,
.main::-webkit-scrollbar,
.right-panel::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 10px;
}

.panel-content::-webkit-scrollbar-track,
.main::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: #eaf2fb;
    border-radius: 0; /* remove rounding */
}

.panel-content::-webkit-scrollbar-thumb,
.main::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background-color: #8fb1d4;
    border-radius: 0; /* remove rounding */
    border: 0; /* remove spacing around thumb */
}

.panel-content::-webkit-scrollbar-thumb:hover,
.main::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #5d87b3;
}


@media (max-width: 768px) {
    .grid-table tbody tr {
        justify-content: flex-start;
    }
    .grid-table td {
        flex: 1 1 45%;
        margin-bottom: 6px;
    }
}

@media (max-width: 480px) {
    body {
        width: 100%; /* full width on small devices */
    }
    .grid-table td {
        flex: 1 1 100%;
    }
}
