/* style.css */

/* Global Reset */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5; /* force flat light background */
}
html, body {
    max-width: 100%;
    overflow-x: hidden;
    background-color: #f5f5f5; /* ensure html also has light background */
}
img, table {
    max-width: 100%;
    height: auto;
}
.team-squares {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.team-square {
    width: 180px;
    height: 180px;
    border: 2px solid #444;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}
.team-square:hover {
    transform: scale(1.05);
    box-shadow: 4px 4px 12px rgba(0,0,0,0.3);
}
/* Header Styles */
header {
    background: #716e6e;
    color: #fff;
    padding: 1rem;
    text-align: center;
    margin-bottom: 20px;
}
.mobile-action {
    display: none;
}
header img {
    height: 150px;
    margin-right: 1rem;
}
header h1 {
    margin: 0;
    font-size: 2em;
    color: #fff;
}
.modalctrl {
    display: none; /* Hidden by default */
    position: fixed; /* Sit on top of the page */
    z-index: 9999; /* High z-index to ensure it's above other elements */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black with opacity */
}
#editScoreModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    padding: 20px;
    width: 90%;
    max-width: 400px;
    z-index: 1000;
    font-family: Arial, sans-serif;
}
.modalctrl-content {
    background-color: #fff;
    margin: 10% auto; /* Adjust as needed for vertical centering */
    padding: 20px;
    border: 1px solid #888;
    width: 50%; /* Adjust width as needed */
}
/* Targeting modal buttons */
.modal .btn-primary {
    background-color: #949494 !important;
    border-color: #7a7a7a !important;
}

.modal .btn-secondary {
    background-color: #949494 !important;
    border-color: #7a7a7a !important;
}
/* Container */
.container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.toggle-button {
    background: #949494;
    color: #fff;
    border: 1px solid #7a7a7a;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 3px;
    margin-left: 5px;
}
.toggle-button:hover {
    background: #949494;
}
.overview-title {
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    font-size: 1.5rem;
}
/* Overview Header & Inline Buttons */
.overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
}
.top-buttons {
    display: inline-flex;
    gap: 0.5rem;
}
.top-buttons a,
.top-buttons button {
    background: #949494;
    color: #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    cursor: pointer;
}
.top-buttons a:hover,
.top-buttons button:hover {
    background: #949494;
}
.mark-leaving-form,
.mark-score-form
{
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}
.pagination button { margin: 2px; }
.session-filter { margin-bottom: 10px; }
/* Group each label-input pair */
.mark-leaving-form .form-group,
.mark-score-form .form-group{
    display: flex;
    flex-direction: column;
}

/* Improve spacing and font-size for mobile devices */
.mark-leaving-form label,
.mark-score-form label{
    font-weight: bold;
    margin-bottom: 0.3rem;
}
.hidden {
    display: none !important;
}
/* Marker and icon styles */
.team-marker { text-align: center; line-height: 1.2; }
.team-marker .team-label { font-size: 14px; font-weight: bold; margin-bottom: 2px; }
.team-marker .team-icon { display: block; width: 25px; height: 41px; }
.team-marker .arrow { display: block; font-size: 16px; }
.route-number {
    background-color: #fff;
    border: 2px solid #949494;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    font-weight: bold;
    color: #555555;
    overflow: hidden;
}
.flag-marker {
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: inherit;
    border: 2px solid #949494;
}
/* Remove default Leaflet container styling for div icons */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.mark-leaving-form select,
.mark-leaving-form input[type="time"],
.mark-leaving-form button,
.mark-score-form select,
.mark-score-form input[type="time"],
.mark-score-form button{
    width: 100%;
    padding: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
}
/* Center the nav content */
.main-nav {
    text-align: center;
    padding: 10px 0;
}
.mobile-toggle {
    display: none;
}
#team_details {
    display: none;
}
/* The menu container only wraps around the menu items */
.menu-container {
    display: inline-block;
    background-color: #f0f0f0; /* Distinct background color */
    padding: 10px 20px;
}
.overwrite-modal-actions {
    text-align: right;
}
#teamSearch {
    margin-left: 20px;
}
.custom-div {
    display: inline-block;
    font-size: 16px;
    margin-left: 10px;
}
/* Horizontal menu styling */
.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}
.container th,
.container td {
    padding: 10px !important;
    border: 1px solid #ddd !important;
}
/* Menu link styles */
.menu a {
    text-decoration: none;
    color: #333;
    padding: 10px 15px;
    transition: background-color 0.3s; /* Smooth hover transition */
}

/* Hover effect for each link */
.menu a:hover {
    background-color: #ddd;
}

.login-container {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    text-align: center; /* If you want centered text */
}
/* Optionally, adjust the button style if needed */
.mark-leaving-form button,
.mark-score-form button{
    background: #949494;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.mark-leaving-form button:hover,
.mark-score-form button:hover{
    background: #949494;
}
/* Filter Buttons */
.filter-buttons {
    text-align: center;
    margin-bottom: 20px;
}
.filter-buttons a {
    text-decoration: none;
    padding: 10px 15px;
    margin: 0 5px;
    background: #949494;
    color: #fff;
    border-radius: 4px;
    font-size: 16px;
}
.filter-buttons a:hover {
    background: #949494;
}
.filter-buttons a.active {
    background: #949494;
}

/* Send Home Form */
.send-home-form {
    text-align: center;
    margin-bottom: 20px;
}
.send-home-form input[type="text"] {
    padding: 8px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 200px;
}
.send-home-form button {
    padding: 8px 16px;
    font-size: 16px;
    background: #949494;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}
.send-home-form button:hover {
    background: #949494;
}
.journey-entry-form { margin: 20px 0; }
.journey-entry-form label { display: block; margin: 8px 0 4px; }
.journey-entry-form input,
.journey-entry-form select,
.journey-entry-form button {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    font-size: 1rem;
    margin-bottom: 10px;
    box-sizing: border-box;
}
.error { color: red; }
.success { color: green; }
.team-details { margin-top: 10px; padding: 10px; border: 1px solid #ccc; }
/* Table & Responsive Styles */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
th, td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}
th {
    background: #949494;
    color: #fff;
}

/* Status & Utility Classes */
.past-eta {
    color: red;
}

/* Form & Link Defaults */
form {
    display: inline;
}
a {
    color: #949494;
    text-decoration: none;
}
button, input[type="submit"], input[type="button"] {
    background: #949494;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 3px;
    font-size: 1rem;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    background: #949494;
}

/* Journey Log Header */
.journey-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}
/* Modal container style */
#overwriteModal, #confirmModal, #arrivalModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    padding: 20px;
    width: 90%;
    max-width: 400px;
    z-index: 1000;
    font-family: Arial, sans-serif;
}
/* Modal header */
#overwriteModal h3 {
    margin-top: 0;
    text-align: center;
}
/* Details sections */
#overwriteModal .journey-details {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}
/* Button styles */
#overwriteModal button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    font-size: 14px;
}
#overwriteModal #confirmOverwrite {
    color: #fff;
}
#overwriteModal #cancelOverwrite {
    background-color: #6c757d;
    color: #fff;
}
#resetPasswordModal, #deleteUserModal, #acceptTeamModal, #checkedTeamModal, #topCheckedModal{
    display: none; /* Hide by default */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    padding: 20px;
    width: 90%;
    max-width: 400px;
    z-index: 1000;
    font-family: Arial, sans-serif;
}
.highlight-yellow {
    background-color: yellow !important;
}
/* Responsive Adjustments */
@media (max-width: 768px) {
    .overview-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .top-buttons {
        margin-top: 10px;
    }
    .mark-leaving-form {
        gap: 1rem;
    }
    .mark-score-form {
        gap: 1rem;
    }
    input[type="time"] {
        font-size: 1.2em;
        padding: 12px;
    }
    .desktop-action {
        display: none;
    }
    .mobile-action {
        display: table-row;
    }
    header h1 {
        margin: 0;
        font-size: 1em;
        color: #fff;
    }
    header img {
        height: 75px;
        margin-right: 1rem;
    }
    h2 {
        font-size: 1em;
    }
    button, input[type="submit"], input[type="button"] {
        background: #949494;
        color: #fff;
        border: none;
        padding: 0.5rem 1rem;
        cursor: pointer;
        border-radius: 3px;
        font-size: 0.8rem;
    }
    /* Always show the navigation, now horizontal */
    .main-nav {
        display: block;
        background-color: #f0f0f0;
        text-align: center;
        padding: 5px 0;
    }

    .menu-container {
        display: inline-block;
        padding: 5px 10px;
    }

    .menu {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 5px;
        margin: 0;
        padding: 0;
    }

    .menu li {
        border: none;
        padding: 0;
        margin: 0;
    }
    .journey-entry-form input,
    .journey-entry-form select,
    .journey-entry-form button {
        font-size: 1rem;
        padding: 8px;
    }
    .journey-entry-form button {
        display: block;
        width: 100%;
    }
    .menu a {
        padding: 5px 10px;
        font-size: 0.8rem;
        display: block;
    }
}

/* ==========================================================
   Modern look & feel overrides (non-breaking, additive)
   - Uses CSS variables and system fonts
   - Keeps existing class names; only improves visuals
   ========================================================== */

:root {
    /* Gray-centric palette around #979797 */
    --brand-primary: #979797;
    --brand-primary-600: #8b8b8b;
    --brand-primary-700: #7a7a7a;
    --brand-accent: #979797;
    --neutral-50: #f7f7f7;
    --neutral-100: #f0f0f0;
    --neutral-200: #e6e6e6;
    --neutral-300: #d4d4d4;
    --neutral-400: #c2c2c2;
    --text-900: #1f2937;
    --text-700: #374151;
    --text-500: #6b7280;
    --surface: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.08);
    --shadow-md: 0 6px 16px rgba(0,0,0,.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* Typography & page background */
html, body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text-900);
    background: #f5f5f5; /* enforce light background */
}

/* Header: gradient and subtle shadow */
header {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-700) 100%);
    color: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-sm);
}
header img {
    height: 150px; /* restore original */
}
header h1 {
    letter-spacing: 0.3px;
}

/* Container as card */
.container {
    background: var(--surface);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Navigation */
.menu-container {
    background: #f0f0f0; /* original feel */
    border-radius: 10px;
    padding: 6px 12px;
}
.menu a {
    color: #333; /* original link color */
    padding: 8px 14px;
    border-radius: 8px;
    transition: background-color .2s ease, color .2s ease;
}
.menu a:hover {
    background-color: #ddd;
}

/* Buttons - unify look */
button,
input[type="submit"],
input[type="button"],
.top-buttons a,
.top-buttons button,
.send-home-form button,
.mark-leaving-form button,
.mark-score-form button {
    background: linear-gradient(180deg, var(--brand-primary), var(--brand-primary-600));
    border: 1px solid rgba(0,0,0,0.1);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: var(--shadow-sm);
    transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
}
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.top-buttons a:hover,
.top-buttons button:hover,
.send-home-form button:hover,
.mark-leaving-form button:hover,
.mark-score-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16,24,40,.18);
}
button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible {
    outline: none;
    box-shadow: var(--shadow-sm), 0 0 0 3px rgba(151,151,151,.35);
}

/* Secondary/neutral buttons */
.toggle-button,
.filter-buttons a,
.menu a.button-like {
    background: linear-gradient(180deg, #9a9a9a, #8a8a8a);
    border: 1px solid rgba(0,0,0,0.08);
}

/* Inputs & selects */
input[type="text"],
input[type="time"],
select {
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--neutral-300);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-900);
    box-shadow: var(--shadow-sm) inset;
    transition: border-color .2s ease, box-shadow .2s ease;
}
input[type="text"]:focus,
input[type="time"]:focus,
select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(151,151,151,.25);
}

.send-home-form input[type="text"] {
    width: 260px;
}

/* Tables */
.table-responsive {
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-300);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}
table {
    border-collapse: separate;
    border-spacing: 0;
}
th {
    background: #979797; /* original gray tone */
    color: #fff;
    font-weight: 600;
    letter-spacing: .3px;
}
tbody tr:nth-child(even) {
    background: var(--neutral-100);
}
tbody tr:hover {
    background: #f1f1f1;
}

/* Badges & chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--neutral-200);
    border: 1px solid var(--neutral-300);
    color: var(--text-700);
    border-radius: 999px;
    font-size: 12px;
}
.chip.success { background: #e7f7e7; border-color: #c7ebc7; color: #206a20; }
.chip.warn { background: #fff5e6; border-color: #ffe0b3; color: #7a4b00; }
.chip.info { background: #eef3ff; border-color: #cfe0ff; color: #254db3; }

/* Flash message */
.flash-message {
    margin: 16px auto 8px;
    padding: 12px 14px;
    width: 100%;
    max-width: 900px;
    border: 1px solid var(--neutral-300);
    border-left: 4px solid #979797;
    border-radius: 10px;
    background: #f5f5f5;
    color: var(--text-700);
    box-shadow: var(--shadow-sm);
}

/* Team squares: soften */
.team-square {
    border: 1px solid var(--neutral-300);
    border-radius: 14px;
    background: #ffffff;
}

/* Modals: generic baseline (id-specific remain supported) */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
}
.modal .modal-content,
#acceptTeamModal .modal-content,
#checkedTeamModal .modal-content,
#topCheckedModal .modal-content {
    background: var(--surface);
    border: 1px solid var(--neutral-300);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 18px;
}

/* Live chat container baseline (detailed in base.css) */
#liveChatContainer {
    display: none;
}

/* Past ETA emphasis */
.past-eta { color: #d61f1f; font-weight: 600; }

/* Dark mode disabled for consistent light theme */
@media (prefers-color-scheme: dark) {
    :root { color-scheme: light; }
    html, body { background: #f5f5f5 !important; background-color: #f5f5f5 !important; }
    .container { background: #ffffff !important; }
    header { background: linear-gradient(135deg, #979797 0%, #7a7a7a 100%) !important; }
    th { background: #979797 !important; color: #fff !important; }
}

