/* ============================================================
   GLOBAL RESET / BASE PAGE
============================================================ */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100% !important;
    overflow-x: hidden !important;
    background: #f5f5f5;
    font-family: Arial, sans-serif;
    scroll-behavior: smooth;
}

/* ============================================================
   MAIN CONTENT WRAPPER — PUSHED BELOW FIXED BARS
============================================================ */

.content {
    padding: 30px 40px;
    max-width: 1400px;
    width: 100%;
    margin: auto;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    margin-top: 260px !important;
}

/* ============================================================
   TOP NAVIGATION (FIXED)
============================================================ */

.centered-nav {
    background: #ffffff;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    gap: 28px;
    border-bottom: 1px solid #ccc;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    z-index: 5000;
}

.centered-nav a {
    font-size: 28px;
    color: #000000;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    white-space: nowrap;
}

.centered-nav a:hover {
    text-decoration: underline;
}

.centered-nav a.active {
    border: 1px solid #999;
    background: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.20);
}

/* ============================================================
   ADD / REMOVE — FIXED BELOW NAV
============================================================ */

.station-actions {
    display: flex;
    gap: 15px;
    justify-content: center;

    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 4500;

    background: white;

    padding: 0 !important;
    height: 60px !important;
    align-items: center !important;

    border-bottom: none;
}

.add-btn, .remove-btn {
    padding: 10px 18px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: white;
}

.add-btn { background: #4CAF50; }
.remove-btn { background: #d9534f; }
.remove-btn:disabled { background: #999; }

/* ============================================================
   STATION DETAILS — FIXED BELOW ACTION BAR
============================================================ */

.info-panel {
    position: fixed;
    top: 120px;
    left: 0;
    right: 0;
    z-index: 4300;

    background: white;
    padding-bottom: 20px;
    padding-top: 0 !important;

    border-bottom: 1px solid #ccc;

    width: 100%;
    max-width: 1400px;
    margin: auto;

    display: flex;
    justify-content: space-between;
}

.info-title {
    font-weight: bold;
    font-size: 20px;
    margin-bottom: 15px;
}

/* ============================================================
   DATA ROWS
============================================================ */

.info-row {
    display: flex;
    margin-bottom: 12px;
    align-items: center;
}

.info-label {
    width: 140px;
    font-weight: bold;
}

.info-value {
    flex: 0 0 auto;
    width: 250px;
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

/* ============================================================
   BUTTON ROW
============================================================ */

.btn-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-row button {
    width: auto !important;
}

.stop-btn, .reset-btn {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    border: none;
    font-weight: bold;
    color: white;
}

.stop-btn { background: #d9534f; }
.reset-btn { background: #f0ad4e; }

/* ============================================================
   STATION GRID
============================================================ */

.layout {
    display: flex;
    gap: 40px;
    width: 100%;
}

#station-grid {
    margin-top: 350px !important;
    flex: 3;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    width: 100%;
}

.station-card {
    background: #ffffff;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: none;
    width: 100%;
}

.station-card:hover {
    transform: none !important;
}

.station-card img {
    width: 150px;
    height: auto;
    pointer-events: none;
}

.station-name {
    font-size: 18px;
    font-weight: bold;
}

/* ============================================================
   POPUPS
============================================================ */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.popup-window {
    background: white;
    width: 320px;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    text-align: center;
}

#new-station-name {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
}

.popup-type-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.popup-type-btn {
    flex: 1;
    padding: 10px;
    background: #0b4fa8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

/* ============================================================
   RESPONSIVE — MOBILE
============================================================ */

@media (max-width: 1200px) {

    /* NAVIGATION */
    .centered-nav {
        padding: 10px 0;
        gap: 12px;
    }

    .centered-nav a {
        font-size: 26px;
    }

    /* CONTENT OFFSET */
    .content {
        margin-top: 280px !important;
        padding: 20px;
    }

    /* STATION GRID / LAYOUT BEHAVIOR */
    .layout {
        display: block;
        width: 100%;
    }

    /* INFO PANEL */
    .info-panel {
        top: 120px !important;
        padding: 12px !important;
        display: flex;
        flex-direction: row !important;
        justify-content: space-between;
        gap: 20px;
        width: 100%;
        max-width: 100% !important;
    }

    /* ⭐ FIXED WIDTH PANELS + LEFT PADDING ⭐ */
    .info-panel-left {
        padding-left: 10px !important;
        width: 100px !important;          /* visual hint */
        flex: 0 0 150px !important;        /* actual width */
    }

    .info-panel-right {
        width: calc(100% - 150px) !important;
        flex: 0 0 calc(100% - 150px) !important;

        /* right panel starts EXACTLY after left panel */
        padding-left: 0 !important;
        margin-left: 0 !important;
    }

    /* ⭐ LABEL + VALUE INLINE ⭐ */
    .info-row {
        display: flex;
        align-items: center;
        justify-content: flex-start !important;
        gap: 2px !important;
        margin-bottom: 6px;
        width: 100%;
    }

    /* ⭐ FIXED LABEL WIDTH FOR PERFECT VALUE ALIGNMENT ⭐ */
    .info-panel-right .info-label {
        width: 120px !important;      /* adjust to match your longest label */
        font-weight: bold;
        text-align: left !important;
    }

    .info-panel-right .info-value {
        flex: 0 0 auto !important;
        width: auto !important;
        background: none !important;
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
    }

    /* GRID */
    #station-grid {
        margin-top: 100px !important;
        padding: 0 10px 40px;
        gap: 12px;
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .station-card {
        transform: scale(0.90);
        margin-bottom: -10px;
        width: 100% !important;
    }

    .station-card img {
        width: 75px !important;
    }

    /* BUTTONS */
    .btn-row button {
        flex: 1;
        padding: 10px;
        font-size: 14px;
    }
}

/* ============================================================
   POPUP BUTTON STYLES
============================================================ */

.popup-confirm {
    background: #4CAF50 !important;
    color: white !important;
    padding: 10px 18px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
}

.popup-cancel {
    background: #d9534f !important;
    color: white !important;
    padding: 10px 18px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
}

.popup-cancel:hover {
    background: #c9302c !important;
}

.popup-close {
    background: #d9534f !important;
    color: white !important;
    padding: 10px 18px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
}

.popup-close:hover {
    background: #c9302c !important;
}
