* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: Arial;
    background-color: #000;
    overflow: hidden;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 10000;
    background: #111;
}

/* Main content container under header */
#main-container {
    display: flex;
    position: absolute;
    /*top: 60px;*/
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(100% - 60px);
    z-index: 1;
    overflow: hidden;
}

/* Map stretches to fill all available space */
#map {
    flex-grow: 1;
    height: 100%;
    width: 100%;
    background-color: #000;
    z-index: 1;
}

/* Player list inside sidebar */
#list {
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

#list::-webkit-scrollbar {
    width: 6px;
}
#list::-webkit-scrollbar-track {
    background: transparent;
}
#list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#list > .entry {
    color: #fff;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    font-family: "Roboto", sans-serif;
    font-weight: 600;
    font-size: 13px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#list > .entry:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #00ffff; /* Light cyan or choose any color you like */
}

.leaflet-control-layers-toggle {
    background-image: url('../../images/map/settingsicon.png') !important;
    background-size: 26px 26px;
    width: 36px;
    height: 36px;
    background-color: #111 !important; /* Optional: change background color */
    border: 1px solid #555;            /* Optional: border for visibility */
    border-radius: 4px;                /* Optional: rounded corners */
}

.leaflet-control-zoom {
    position: fixed !important;
    top: 70px !important;  /* adjust to below your header height */
    left: 10px !important; /* or right: 10px if you prefer right side */
    z-index: 10000 !important;
}

.car-class-icon {
    pointer-events: none;
}

.event-icon-wrapper {
    position: relative;
    width: 32px; 
    height: 32px;
}

.event-main-icon {
    position: absolute;
    width: 22px;
    height: 22px;
    top: 0;
    left: 0;
}

.car-class-icon-top {
    position: absolute;
    width: 14px;
    height: 14px;
    top: -5px;   
    left: -5px; 
    z-index: 10;
    pointer-events: none;
    filter: drop-shadow(0 0 1px #000);
}

/* Mobile Optimizations */

@media (max-width: 768px) {
    #main-container {
        flex-direction: column;
        height: calc(100% - 60px);
    }

    #map-wrapper {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 100% !important;
        height: 60vh !important;  /* Map takes about 60% of viewport height */
    }

    #map {
        width: 100% !important;
        height: 100% !important;
    }

    #list-outer {
        position: relative !important;
        top: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 40vh !important; /* Sidebar below map takes remaining height */
        padding: 8px 12px;
        box-shadow: none;
        backdrop-filter: none;
        overflow-x: auto;
        overflow-y: hidden;
        display: flex;
        align-items: center;
        background: #111;
        z-index: 9999;
    }

    #list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        width: 100%;
    }

    #list > .entry {
        display: inline-block;
        padding: 6px 12px;
        margin-right: 10px;
        border-bottom: none;
        font-size: 14px;
        white-space: nowrap;
        cursor: pointer;
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        color: #fff;
        transition: background-color 0.2s ease;
    }

    #list > .entry:hover {
        background-color: rgba(0, 255, 255, 0.3);
        color: #0ff;
    }

    /* Reposition zoom control to bottom-left on mobile */
    .leaflet-control-zoom {
        position: fixed !important;
        top: auto !important;
        bottom: 70px !important;
        left: 10px !important;
        right: auto !important;
        z-index: 10000 !important;
    }

    /* Make layers toggle smaller and reposition */
    .leaflet-control-layers-toggle {
        width: 32px !important;
        height: 32px !important;
        background-size: 20px 20px !important;
        position: fixed !important;
        bottom: 120px !important;
        left: 10px !important;
        z-index: 10000 !important;
        border-radius: 4px;
    }
}


.event-detail-name {
    color: #fff;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin-top: 8px;
    font-family: "Roboto", sans-serif;
}

.back-button {
    font-size: 14px;
    color: #0ff;
    text-align: left;
    padding: 10px;
    cursor: pointer;
    user-select: none;
    background-color: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.back-button:hover {
    background-color: rgba(0, 255, 255, 0.1);
}

/* Optional: animate switching views in #list */
#list {
    transition: all 0.3s ease;
    opacity: 1;
}

#list.event-mode {
    background-color: #111;
    padding-top: 5px;
    animation: fadeInList 0.3s ease;
}

@keyframes fadeInList {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-marker.disabled {
    opacity: 0.5;
    filter: grayscale(100%);
}

.event-detail-name-container {
    display: flex;
    align-items: center;
    gap: 8px; /* space between avatar and name */
    padding-top: 10px;
}

.event-detail-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid #ccc;
}

.car-class-overlay-icon {
    position: absolute;
    top: -4px;   /* tweak to position nicely */
    left: -2px; /* tweak to position nicely */
    width: 18px;
    height: 18px;
    border-radius: 50%; /* circle */
    border: 1px solid white;
    background: white;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
    object-fit: cover;
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ccc;
}

