/* ===== Global Dark Theme ===== */

body {
    background-color: #121212;
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

a {
    color: #90caf9;
    text-decoration: none;
}

a:hover {
    color: #64b5f6;
}


/* ===== Container for page content ===== */

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}


/* ===== Flex layout for table + map ===== */

.flex-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    min-height: 80vh;
    /* full page minus header */
}

.left-column {
    flex: 1 1 40%;
    /* table takes 40% */
    overflow-x: auto;
    /* scroll for wide tables */
}

.right-column {
    flex: 1 1 60%;
    /* map takes 60% */
}


/* ===== Headings ===== */

h1,
h2,
h3 {
    color: #ffffff;
    margin-bottom: 20px;
    text-align: center;
}


/* ===== Buttons ===== */

button,
.btn-control,
a.btn-logout {
    padding: 8px 16px;
    border-radius: 5px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

button:hover,
.btn-control:hover,
a.btn-logout:hover {
    opacity: 0.9;
}


/* Specific Buttons */

.btn-control {
    background-color: #1976d2;
    color: #fff;
}

a.btn-logout {
    background-color: #e53935;
    color: #fff;
}


/* Forms */

input,
textarea,
select,
button {
    font-size: 14px;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 5px;
    border: none;
}

input,
textarea,
select {
    background-color: #1e1e1e;
    color: #ffffff;
    width: 100%;
}

button {
    background-color: #1976d2;
    color: #fff;
}


/* Success / Error messages */

.success {
    color: #4caf50;
    font-weight: bold;
    margin-bottom: 10px;
}

.error {
    color: #e53935;
    font-weight: bold;
    margin-bottom: 10px;
}


/* Tables */

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #f72121;
    text-align: left;
}

thead th {
    text-align: center;
}

tr:nth-child(even) {
    background-color: #1a1a1a;
}


/* Reaction Buttons */

form.inline button {
    display: inline-block;
    margin-right: 5px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    background-color: #1976d2;
    color: #fff;
    border: none;
    cursor: pointer;
}

form.inline button:hover {
    background-color: #1565c0;
}


/* Delete Button */

.btn-delete {
    background-color: #e53935;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-delete:hover {
    background-color: #d32f2f;
}


/* Add/Edit Forms */

.event-form input,
.event-form textarea,
.event-form button {
    display: block;
    width: 100%;
    margin-bottom: 12px;
}

.event-form input,
.event-form textarea {
    background-color: #1e1e1e;
    color: #ffffff;
}

.event-form button {
    background-color: #1976d2;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
}

.event-form button:hover {
    background-color: #1565c0;
}


/* Map container */

#map {
    width: 90%;
    height: 100%;
    border-radius: 8px;
    border: 1px solid #333;
}


/* ===== Mobile Responsiveness ===== */

@media (max-width: 768px) {
    .flex-container {
        flex-direction: column;
        gap: 10px;
        /* reduce gap between table and map */
    }
    .left-column,
    .right-column {
        flex: 1 1 100%;
    }
    .left-column {
        overflow-x: auto;
    }
    /* Table adjustments */
    .left-column table {
        display: inline-table !important;
        width: auto !important;
        /* shrink to content */
        min-width: 250px;
        /* smaller min-width */
        font-size: 11px;
        /* smaller text */
    }
    .left-column th,
    .left-column td {
        padding: 4px 3px;
        /* smaller padding */
        white-space: normal;
        word-wrap: break-word;
    }
    /* Buttons */
    .btn-control,
    button,
    a.btn-logout {
        width: auto !important;
        padding: 6px 12px;
        font-size: 12px;
        /* smaller buttons */
        margin-bottom: 8px;
    }
    h1,
    h2,
    h3 {
        font-size: 1.1em;
        /* smaller headings */
    }
    #map {
        height: 250px;
        /* smaller map for mobile */
    }
}


/* ===== Marquee Ticker ===== */

.marquee-container {
    width: 100%;
    background-color: #1976d2;
    color: #fff;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    padding: 8px 0;
    font-weight: bold;
}

.marquee {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 19s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}


/* Visitor Submit Form Container */

.visitor-submit {
    max-width: 500px;
    margin: 30px auto 30px auto;
    /* top & bottom spacing */
    padding: 15px;
    background-color: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #333;
}


/* Form heading */

.visitor-submit h2 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.3em;
}


/* Inputs and textarea */

.visitor-submit input,
.visitor-submit textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 5px;
    border: 1px solid #333;
    background-color: #1e1e1e;
    color: #ffffff;
    /* typed text visible */
    margin-bottom: 10px;
}


/* Placeholder text for visibility */

.visitor-submit input::placeholder,
.visitor-submit textarea::placeholder {
    color: #bbbbbb;
    opacity: 1;
}


/* Specific styling for date/time to make text visible */

.visitor-submit input[type="date"],
.visitor-submit input[type="time"] {
    color: #ffffff;
    /* typed date/time visible */
}


/* Make date/time icons white on webkit browsers */

.visitor-submit input[type="date"]::-webkit-calendar-picker-indicator,
.visitor-submit input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}


/* Submit button */

.visitor-submit .event-form button {
    width: 100%;
    padding: 10px;
    background-color: #1976d2;
    color: #fff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 5px;
}

.visitor-submit .event-form button:hover {
    background-color: #1565c0;
}


/* Limit overall width of the submit form itself */

.visitor-submit .event-form {
    max-width: 90%;
    /* slightly narrower than container */
    margin: 0 auto;
    /* center it */
}


/* Limit each input/textarea to be narrower than the form */

.visitor-submit input,
.visitor-submit textarea {
    width: 95%;
    /* reduce from 100% so they don’t touch edges */
    margin-left: auto;
    margin-right: auto;
    display: block;
    /* ensures the margin auto centers them */
}