/* ===================== */
/* GENERAL */
/* ===================== */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, #f7f7f7, #ffffff);
    color: #1d2b36;
}

/* ===================== */
/* HEADER */
/* ===================== */

.top-header {
    display: flex;
    align-items: center;
    background: linear-gradient(to right, #ffffff, #3A7D44);
    padding: 60px 20px;
    margin-left: 270px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.top-header h1 {
    color: #003366;
    margin: 0;
    font-size: 1.8em;
    letter-spacing: 0.5px;
}

/* ===================== */
/* CONTAINER */
/* ===================== */

.container {
    display: flex;
    min-height: calc(100vh - 120px);
}

/* ===================== */
/* SIDE MENU */
/* ===================== */

.side-menu {
    width: 270px;
    background-color: #3A7D44;
    color: white;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding-top: 0;
    padding-bottom: 20px;
    text-align: left;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    box-shadow: 3px 0 8px rgba(0, 0, 0, 0.25);
}

.side-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-menu li {
    margin: 0;
}

.side-menu a {
    color: white;
    text-decoration: none;
    padding: 10px 10px 10px 18px;
    display: block;
    transition: background-color 0.25s ease, padding-left 0.25s ease;
}

.side-menu ul a:hover {
    background-color: #60A066;
    padding-left: 22px;
}

.side-menu ul a.active {
    background-color: #60A066;
    border-left: 4px solid #ffffff;
}

.side-menu li.active-parent > a {
    background-color: #60A066;
}

.side-menu > a:hover {
    background: none;
}

/* ===================== */
/* LOGO */
/* ===================== */

.side-logo {
    max-width: 400px;
    height: auto;
    display: block;
    margin: -25px 0 10px -70px;
    transition: transform 0.2s ease;
}

.side-logo:hover {
    transform: translateY(-2px);
}

/* ===================== */
/* SUBMENU */
/* ===================== */

.has-submenu > a {
    position: relative;
}

.has-submenu > a::after {
    content: "▸";
    position: absolute;
    right: 10px;
    transition: transform 0.25s ease;
}

.has-submenu.open > a::after {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    padding-left: 20px;
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
    transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
}

.has-submenu.open > .submenu {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    background-color: #60A066;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.15);
}

.submenu li a {
    font-size: 0.95em;
    padding: 8px 10px 8px 18px;
    color: white;
}

.submenu li a:hover {
    background-color: #6fb077;
}

/* ===================== */
/* MAIN CONTENT */
/* ===================== */

.main-content {
    margin-left: 270px;
    flex: 1;
    padding: 28px 30px 40px;
    background: white;
    border-radius: 6px;
    min-height: calc(100vh - 180px);
}

.intro-layout {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
}

.content-area {
    flex: 1;
    min-width: 0;
}

/* ===================== */
/* TEXT / PANEL SWITCH */
/* ===================== */

.section-visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.section-hidden {
    display: none;
    opacity: 0;
    transform: translateY(12px);
}

.central-text {
    max-width: 760px;
    margin: 0;
    text-align: left;
    line-height: 1.7;
}

.central-text h2 {
    font-size: 2em;
    font-weight: bold;
    color: #003366;
    margin-top: 0;
    margin-bottom: 20px;
}

.central-text p {
    margin-bottom: 16px;
}

/* ===================== */
/* STATION IMAGE */
/* ===================== */

.station-image-wrapper {
    width: 250px;
    flex-shrink: 0;
    text-align: center;
    position: sticky;
    top: 30px;
    align-self: flex-start;
}

.station-image {
    width: 100%;
    max-width: 220px;
    height: auto;
    cursor: pointer;
    border-radius: 14px;
    background: #ffffff;
    padding: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    animation: stationNudge 4s ease-in-out infinite;
}

.station-image.stop-animation {
    animation: none;
}

.station-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.18);
}

.station-image-note {
    margin-top: 12px;
    font-size: 0.95rem;
    color: #466172;
    font-weight: bold;
}

@keyframes stationNudge {
    0%   { transform: translateY(0) rotate(0deg); }
    5%   { transform: translateY(-4px) rotate(-3deg); }
    10%  { transform: translateY(2px) rotate(3deg); }
    15%  { transform: translateY(-4px) rotate(-3deg); }
    20%  { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* ===================== */
/* STATION PANEL */
/* ===================== */

.station-panel {
    max-width: 760px;
}

.filters-card {
    background: #f8fbf8;
    border: 1px solid #d7e8da;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

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

.filters-title {
    font-size: 1.6em;
    font-weight: bold;
    color: #003366;
    margin: 0;
}

.back-button {
    border: none;
    background: #3A7D44;
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.back-button:hover {
    background: #2f6637;
    transform: translateY(-1px);
}

.filter-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.filter-row label {
    font-weight: bold;
    color: #003366;
    margin-bottom: 7px;
}

.filter-row select {
    padding: 11px 12px;
    background: #ffffff;
    border: 1px solid #a9cdb0;
    border-radius: 10px;
    color: #003366;
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-row select:focus {
    border-color: #3A7D44;
    box-shadow: 0 0 0 3px rgba(58, 125, 68, 0.15);
}

/* ===================== */
/* DATE RANGE */
/* ===================== */

.date-range-box {
    margin-top: 18px;
    max-width: 760px;
    background: #f8fbf8;
    border: 1px solid #d7e8da;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
}

.date-range-row {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.date-field {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.date-field label {
    font-weight: bold;
    color: #003366;
    margin-bottom: 7px;
}

.date-field input[type="date"] {
    padding: 11px 12px;
    background: #ffffff;
    border: 1px solid #a9cdb0;
    border-radius: 10px;
    color: #003366;
    font-weight: bold;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.date-field input[type="date"]:focus {
    border-color: #3A7D44;
    box-shadow: 0 0 0 3px rgba(58, 125, 68, 0.15);
}

.date-actions {
    display: flex;
    align-items: end;
}

.info-box-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
}

.info-box {
    background: #ffffff;
    border: 1px solid #d7e8da;
    border-left: 5px solid #3A7D44;
    border-radius: 12px;
    padding: 12px 14px;
    color: #355161;
    font-weight: bold;
    line-height: 1.5;
}

/* ===================== */
/* CHART */
/* ===================== */

.chart-container {
    width: 100%;
    max-width: 760px;
    margin: 24px 0 0;
    text-align: center;
    display: none;
    background: #ffffff;
    border: 1px solid #e2e8ee;
    border-radius: 16px;
    padding: 20px;
    box-sizing: border-box;
    height: 420px;
    scroll-margin-top: 110px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* ===================== */
/* FOOTER */
/* ===================== */

footer {
    text-align: center;
    padding: 15px;
    background-color: #e0e0e0;
    margin-top: 20px;
}

/* ===================== */
/* RESPONSIVE */
/* ===================== */

@media (max-width: 1100px) {
    .intro-layout {
        flex-direction: column-reverse;
        align-items: flex-start;
    }

    .station-image-wrapper {
        width: 100%;
        text-align: left;
        position: static;
    }

    .station-image {
        max-width: 220px;
    }
}

@media (max-width: 768px) {
    .side-menu {
        position: relative;
        width: 100%;
        height: auto;
    }

    .top-header {
        margin-left: 0;
        padding: 30px 16px;
    }

    .top-header h1 {
        font-size: 1.3em;
    }

    .container {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        padding: 20px 16px 30px;
        min-height: auto;
    }

    .side-logo {
        max-width: 260px;
        margin: -10px auto 10px;
    }

    .station-image-wrapper {
        text-align: center;
        position: static;
    }

    .station-image {
        max-width: 200px;
    }

    .filters-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .back-button {
        width: 100%;
    }

    .date-range-row {
        flex-direction: column;
        align-items: stretch;
    }

    .date-field {
        min-width: auto;
        width: 100%;
    }

    .date-actions {
        width: 100%;
    }

    .date-actions .back-button {
        width: 100%;
    }

    .chart-container {
        height: 320px;
    }
}