:root {
    --bg-color: #ffffff;
    --sidebar-bg: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #212529;
    --text-muted-color: #6c757d;
    --accent-color: #007bff;
    --accent-color-hover: #0056b3;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* Prevent scrolling on main map page */
}

/* Allow scrolling on the log page */
body.log-page {
    overflow: auto;
}


#main-wrapper {
    display: flex;
    height: 100vh;
}

#sidebar {
    width: 320px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--sidebar-bg);
}

#map {
    flex-grow: 1;
    height: 100vh;
    background-color: #ffffff;
}

h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

#instructions {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    margin-top: 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
}
#instructions p {
    margin: 0.75rem 0;
    line-height: 1.6;
    color: var(--text-muted-color);
}
#instructions p:first-child {
    margin-top: 0;
}
#instructions p:last-child {
    margin-bottom: 0;
}

#server-tabs-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

#server-tabs {
    display: flex;
    flex-direction: column;
}

#server-tabs a {
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease-in-out;
    font-weight: 500;
}
#server-tabs a:last-child {
    border-bottom: none;
}
#server-tabs a:not(.disabled):hover {
    background-color: #e9ecef;
}
#server-tabs a.active {
    background-color: var(--accent-color);
    color: #ffffff;
    font-weight: 700;
}
#server-tabs a.disabled {
    color: #adb5bd;
    background-color: #f8f9fa;
    cursor: not-allowed;
}

#actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem; /* Add space above buttons */
}

#actions button {
    padding: 0.75rem;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}
#actions button:hover {
    background-color: var(--accent-color);
    color: #ffffff;
}

#coords-display {
    font-family: monospace;
    background-color: #e9ecef;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    color: var(--text-muted-color);
}


/* --- Map-specific popup styles --- */
.popup-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.popup-title {
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}
.popup-menu button {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
}
.popup-menu button:hover {
    background-color: #f0f0f0;
}

.supply-icon {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    line-height: 20px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    user-select: none;
}

.user-marker-icon {
    font-size: 28px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    text-align: center;
    line-height: 24px;
    user-select: none;
}

/* --- Log page table --- */
table {
    width: 80%;
    margin: 20px auto;
    border-collapse: collapse;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
th, td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}
th {
    background-color: #f4f4f4;
    font-weight: bold;
}
tbody tr:nth-of-type(even) {
    background-color: #f9f9f9;
}
tbody tr:hover {
    background-color: #f1f1f1;
}

/* Media query for smaller screens */
@media (max-width: 768px) {
    #main-wrapper {
        flex-direction: column;
    }
    #sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    #map {
        height: 100%;
    }
}