#map {
    height: 100vh;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
}

/* ===== SIDEBAR WRAPPER ===== */
.sidebar-wrapper {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    max-height: 97vh;
    z-index: 2;
}

.sidebar-wrapper.open {
    transform: translateY(-50%) translateX(15px);
}

.sidebar {
    display: flex;
    flex-direction: column;
    max-height: 97vh;
    background: rgb(27, 27, 27);
    box-shadow: 2px 0px 5px rgb(0, 0, 0);
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 20px;
    padding: 20px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar-body::-webkit-scrollbar { width: 4px; }
.sidebar-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ===== HEADER ===== */
.header-container {
    display: flex;
    flex-shrink: 0;
    height: 60px;
    align-items: center;
    justify-content: center;
    background-color: rgb(20, 20, 20);
    box-shadow: 0px 1px 5px rgb(12, 12, 12);
    width: 235px;
}
.title-text { color: white; font-family: Montserrat; font-size: 36px; font-weight: 500; }

/* ===== SLIDE HANDLE ===== */
.slide-handle {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 48px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    margin-left: 8px;
}

/* ===== PANELS ===== */
.release-display-container {
    display: grid;
    background-color: rgb(40, 40, 40);
    width: 180px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    row-gap: 8px;
    column-gap: 10px;
    padding: 10px;
}
.release-text {
    grid-column: span 2;
    font-family: Montserrat;
    font-weight: 500;
    font-size: 14px;
    color: rgb(180, 180, 180);
}
#city-search {
    grid-column: span 2;
    width: 153px;
    padding: 5px;
    font-family: Montserrat;
    font-size: 12px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}
.city-dropdown {
    position: absolute;
    background: rgb(255, 255, 255);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    width: 163px;
    top: 187px;
    z-index: 10;
    font-family: Montserrat;
    font-size: 12px;
    color: rgb(0, 0, 0);
    font-weight: 500;
}
.city-dropdown div { padding: 5px 10px; cursor: pointer; }
.city-dropdown div:hover { background: rgb(220, 220, 220); }

.lat-text, .lon-text {
    color: rgb(180, 180, 180);
    font-family: Montserrat;
    font-size: 12px;
}
.lat-field, .lon-field {
    width: 58px;
    background: rgb(255, 255, 255);
    color: rgb(0, 0, 0);
    padding: 5px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

.yield-container {
    width: 180px;
    display: flex;
    flex-direction: column;
    font-family: Montserrat;
    font-size: 12px;
    padding: 10px;
    font-weight: 500;
    color: rgb(180, 180, 180);
    row-gap: 12px;
    background-color: rgb(40, 40, 40);
}
.yield-text { font-size: 14px; }
#yield-select, #custom-yield {
    width: 165px;
    padding: 5px;
    background: rgb(255, 255, 255);
    color: rgb(0, 0, 0);
    font-family: Montserrat;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    cursor: pointer;
    box-sizing: border-box;
    margin-bottom: 5px;
}

#yield-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23333'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
}

.import-container {
    display: flex;
    width: 200px;
    color: rgb(180, 180, 180);
    font-family: Montserrat;
    font-size: 12px;
    font-weight: 500;
    align-items: center;
    column-gap: 3px;
    white-space: nowrap;
}
#import-geojson {
    font-size: 12px;
    padding: 3px;
    background: rgb(40, 40, 40);
    border: 1px solid rgb(100, 100, 100);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-family: Montserrat;
}
#autozoom-checkbox { cursor: pointer; }

/* ===== BUTTONS ===== */
.simulation-btn-container {
    width: 200px;
    display: flex;
    justify-content: center;
    column-gap: 15px;
    align-items: center;
}
.btn-primary {
    display: flex;
    justify-content: center;
    width: 150px;
    border: none;
    color: white;
    padding: 15px;
    border-radius: 2px;
    font-family: Montserrat;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}
.btn-primary:hover { opacity: 0.8; }
#start-simulation, #resume-simulation, #export-geojson { background-color: #244886; }
#stop-simulation { background-color: rgb(206, 61, 61); }
#resume-simulation, #stop-simulation, #export-geojson { display: none; }
#reset-simulation {
    border: none;
    padding: 10px;
    border-radius: 2px;
    cursor: pointer;
    background-color: rgb(206, 61, 61);
}
#reset-simulation:hover { opacity: 0.8; }
.reset-btn-img { height: 22.5px; }

/* ===== CURRENT DAY ===== */
#current-day {
    position: absolute;
    color: white;
    font-family: Montserrat;
    font-size: 14px;
    font-weight: 500;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

/* ===== TIMELINE ===== */
.timeline-container {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(27, 27, 27, 0.95);
    padding: 15px 20px;
    border-radius: 8px;
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 50%;
    z-index: 2;
}
.timeline-controls { display: flex; gap: 10px; justify-content: center; }
.timeline-btn {
    width: 50px;
    height: 30px;
    background: rgb(40, 40, 40);
    border: 1px solid rgb(100, 100, 100);
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: Montserrat;
    font-size: 14px;
}
.timeline-btn:hover { background: rgb(60, 60, 60); }
.timeline-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgb(60, 60, 60);
    border-radius: 3px;
    outline: none;
}
.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #244886;
    cursor: pointer;
}
.timeline-labels {
    display: flex;
    justify-content: space-between;
    color: rgb(180, 180, 180);
    font-family: Montserrat;
    font-size: 11px;
}

/* ===== LEGEND ===== */
#concentration-legend {
    position: absolute;
    top: 50%;
    transform: translateY(-30%);
    right: 15px;
    display: none;
    gap: 10px;
    z-index: 2;
    background: rgb(15, 15, 15);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: monospace;
    pointer-events: none;
}
.legend-bars { display: flex; flex-direction: column; gap: 2px; }
.legend-bars div { height: 20px; width: 30px; }
.legend-labels { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.legend-labels div { color: white; font-size: 10px; line-height: 20px; white-space: nowrap; }

/* ===== TABLET (≤768px) ===== */
@media (max-width: 768px) {
    .sidebar-body { row-gap: 16px; padding: 16px 0; }
    .header-container { width: 220px; }
    .logo { width: 36px; margin-left: 25px; margin-right: 25px; }
    .title-text { font-size: 24px; }

    .import-container { width: 170px; font-size: 10px; }
    #import-geojson { font-size: 9px; padding: 2px 5px; }

    .release-display-container { width: 170px; padding: 8px 10px; row-gap: 6px; column-gap: 6px; }
    .release-text { font-size: 13px; }
    .lat-text, .lon-text { font-size: 11px; }
    .lat-field, .lon-field { width: 56px; font-size: 11px; padding: 4px; }
    #city-search { width: 143px; font-size: 10px; }

    .yield-container { width: 170px; padding: 8px 10px; row-gap: 6px; font-size: 11px; }
    #yield-select, #custom-yield { width: 150px; font-size: 10px; }

    .simulation-btn-container { width: 190px; height: 20px; margin-top: 8px; column-gap: 15px; }
    .btn-primary { width: 170px; padding: 10px 14px; font-size: 12px; }
    #reset-simulation { padding: 6px; }
    .reset-btn-img { height: 20px; }

    .timeline-container { bottom: 6px; width: 92%; padding: 10px 14px; gap: 6px; }
    .timeline-btn { width: 40px; height: 26px; font-size: 12px; padding: 3px; }
    .timeline-labels { font-size: 10px; }

    #current-day { font-size: 12px; bottom: 25px; }

    .legend-bars div { height: 15px; width: 20px; }
    .legend-labels div { font-size: 8px; line-height: 15px; }
}

/* ===== PHONE (≤480px) ===== */
@media (max-width: 480px) {
    .sidebar-wrapper{top: 36%; }
    .sidebar-body { row-gap: 10px; padding: 10px 0; }
    .header-container { width: 150px; height: 36px; }
    .logo { width: 20px; margin-left: 14px; margin-right: 12px; }
    .title-text { font-size: 20px; }

    .import-container { width: 120px; font-size: 7px; column-gap: 2px; }
    #import-geojson { font-size: 6px; padding: 2px 4px; }
    #autozoom-checkbox { width: 12px; height: 12px; }

    .release-display-container { width: 120px; padding: 6px 8px; row-gap: 4px; column-gap: 4px; }
    .release-text { font-size: 10px; }
    .lat-text, .lon-text { font-size: 9px; }
    .lat-field, .lon-field { width: 42px; font-size: 10px; padding: 3px; }
    #city-search { width: 103px; font-size: 8px; padding: 5px 3px; }

    .yield-container { width: 120px; padding: 6px 8px; row-gap: 4px; font-size: 10px; }
    #yield-select, #custom-yield { width: 110px; font-size: 8px; }

    .simulation-btn-container { width: 120px; column-gap: 10px; height: 10px; }
    .btn-primary { width: 100px; padding: 8px 10px; font-size: 10px; }
    #reset-simulation { padding: 4px; }
    .reset-btn-img { height: 16px; }

    .timeline-container { bottom: 4px; width: 95%; padding: 6px 8px; gap: 4px; }
    .timeline-btn { width: 32px; height: 22px; font-size: 10px; padding: 2px; }
    .timeline-labels { font-size: 9px; }

    #current-day { font-size: 10px; bottom: 35px; }

    .legend-bars div { height: 12px; width: 15px; }
    .legend-labels div { font-size: 7px; line-height: 12px; }
    #concentration-legend {
        top: auto;
        bottom: 16%;
        left: 15px;
        right: auto;
        transform: none;
        width: 70px;
        height: auto;
    }
}