html,
body {
    height: 100%;
    margin: 0;
}

#map {
    width: 100%;
    height: 100vh;
}

/* Hide by default */

/* Fuel Station Markers */
.ol-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
}

/* Fuel Station Icon Styling */
.ol-layer .ol-unselectable {
    cursor: pointer;
}

.copyright-text {
    display: none;
    margin-top: 15px;
    font-size: 12px;
    text-align: center;
}

/* Show only when menu is open */
#ui-panel.open .copyright-text {
    display: block;
}

.copyright-symbol {
    color: #888888;
}

.ltg-brand {
    color: #fec700;
    font-weight: bold;
}

/* Loading Screen Styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

/* Loading Animation */
#loading-animation-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 223, 0, 0.8);
    border-radius: 50%;
    margin: 0 6px;
    animation: dotMovement 1s linear infinite alternate;
    box-shadow: 0 0 5px rgba(255, 223, 0, 0.8);
}

.dot:nth-child(1) {
    animation-delay: 0.2s;
}

.dot:nth-child(2) {
    animation-delay: 0.4s;
}

.dot:nth-child(3) {
    animation-delay: 0.6s;
}

.dot:nth-child(4) {
    animation-delay: 0.8s;
}

.dot:nth-child(5) {
    animation-delay: 1s;
}

@keyframes dotMovement {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-20px);
    }
}

/* Loading Text */
#loading-text {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 30px;
    margin-top: 0;
    text-shadow: 0 0 5px rgba(255, 223, 0, 0.8);
    animation: pulseText 3s ease-in-out infinite;
}

@keyframes pulseText {

    0%,
    20%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Add this to your existing CSS */
.ol-viewport {
    background-color: #252525 !important; /* Black background */
}


/* UI Panel Styles */
#ui-panel {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(51, 51, 51, 0.9);
    color: #fff;
    border-radius: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 11;
    overflow: hidden;
    width: 60px;
    transition: width 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.3);
}

#ui-panel:hover {
    box-shadow: 0 0 12px 4px rgba(255, 223, 0, 0.8);
}

#ui-panel.open:hover {
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.3);
}

#ui-panel.open {
    width: 240px;
    padding: 15px;
    min-height: 100px;
}

#toggle-ui-button {
    background: none;
    border: none;
    font-size: 26px;
    color: #fff;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    border-radius: 10px;
}

#ui-panel.open #toggle-ui-button {
    text-align: left;
}

#toggle-ui-button:focus {
    outline: none;
}

#ui-content {
    padding: 0 15px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
}

#ui-panel.open #ui-content {
    max-height: 500px;
    padding: 15px;
}

/* Menu sections */
.menu-section {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.menu-section:hover {
    box-shadow: 0 0 12px 4px rgba(254, 199, 0, 0.6);
    /* Changed from rgba(255, 223, 0, 0.8) */
}

.switch:hover .slider {
    background-color: #ccc;
    /* Makes inactive toggle more visible on hover */
}

input:checked:hover+.slider {
    background-color: #ffdf00;
    /* Slightly lighter on hover */
}

.menu-section h3 {
    margin: 0 0 8px;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
}

/* Link buttons */
.link-button {
    display: block;
    width: calc(100% - 10px);
    /* Added to account for padding */
    padding: 8px 5px;
    /* Reduced side padding */
    margin: 5px 0;
    background: #fec700;
    /* Changed color */
    color: #333;
    /* Changed text color for better contrast */
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.2s;
    font-size: 14px;
    font-weight: bold;
    /* Added bold text */
    border: none;
    /* Added to remove default link styling */
}

.link-button:hover {
    background: #ffdf00;
    /* Slightly lighter yellow on hover */
    transform: translateY(-2px);
    color: #222;
    /* Darker text on hover */
    text-decoration: none;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-top: 10px;
}

.toggle-container span {
    font-size: 16px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #fec700;
    /* Changed from rgba(255, 223, 0, 0.8) */
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Search box */
#search-container {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    z-index: 10;
    background: none;
    margin: 0;
    padding: 0;
}

#search-container input {
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 16px;
    color: #fff;
    box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2);
    outline: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#search-container input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#search-container input:focus {
    background-color: rgba(0, 0, 0, 0.7);
    box-shadow: inset 0 0 10px rgba(255, 223, 0, 0.8);
    border: 1px solid rgba(255, 223, 0, 0.8);
}

.search-results {
    position: absolute;
    top: 50px;
    right: 10px;
    left: auto;
    width: 250px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 5px;
    max-height: 250px;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 223, 0, 0.8);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 223, 0, 1);
}

.search-results div {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 15px;
    color: #fff;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    margin-bottom: 2px;
}

.search-results div:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.search-results div:hover {
    background-color: rgba(255, 223, 0, 0.8);
    color: black;
}

/* Player Info Popup */
#player-info {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(40, 40, 40, 0.95);
    color: white;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#player-info.active {
    display: block;
}

#player-info h2 {
    margin-top: 0;
    color: #FFD700;
    font-size: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 10px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.close-btn:hover {
    color: #FFD700;
}

.player-info-row {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
}

.player-info-label {
    font-weight: bold;
    color: #FFD700;
}

.player-info-value {
    text-align: right;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-info-header {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFD700;
}

/* Following indicator */
.following-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 223, 0, 0.5);
    border: 2px solid rgba(255, 223, 0, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.9;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
}

/* Maple Leaf VTC — warm burgundy, neutral charcoal, ivory */
:root {
    --maple-bg: #171313;
    --maple-panel: #241919;
    --maple-card: #381D20;
    --maple-red: #701D28;
    --maple-red-hover: #87303B;
    --maple-ivory: #F5EEDB;
    --maple-gold: #F2CD82;
    --maple-muted: #C3A58C;
    --maple-border: #78564C;
}
body { color: var(--maple-ivory); font-family: 'Segoe UI', Tahoma, sans-serif; }
.ol-viewport { background-color: var(--maple-bg) !important; }
#loading-screen { background: radial-gradient(circle at 50% 38%, #38201E 0%, var(--maple-bg) 70%); gap: 28px; }
.loading-brand { text-align: center; color: var(--maple-ivory); padding: 24px; }
.loading-leaf { display: block; font-size: 64px; line-height: 1.1; filter: drop-shadow(0 0 12px rgba(112,29,40,.3)); }
.loading-brand h1 { margin: 15px 0 7px; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(28px, 4vw, 48px); font-weight: 600; letter-spacing: .035em; }
.loading-brand p { margin: 0; font-size: 12px; letter-spacing: .3em; color: var(--maple-gold); font-weight: 700; }
#loading-text { font-size: 15px; color: var(--maple-muted); text-shadow: none; animation: none; bottom: 42px; left: 50%; transform: translateX(-50%); white-space: nowrap; text-align: center; max-width: 90vw; }
#loading-animation-container { bottom: 82px; right: auto; left: 50%; transform: translateX(-50%); }
.dot { width: 9px; height: 9px; background: var(--maple-gold); box-shadow: 0 0 7px rgba(242,205,130,.28); margin: 0 4px; }
#ui-panel { background: rgba(36,25,25,.97); color: var(--maple-ivory); border: 1px solid var(--maple-border); box-sizing: border-box; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
#ui-panel:hover { box-shadow: 0 0 12px rgba(112,29,40,.4), 0 4px 18px rgba(0,0,0,.4); }
#ui-panel.open:hover { box-shadow: 0 0 12px rgba(112,29,40,.32), 0 5px 22px rgba(0,0,0,.42); }
#toggle-ui-button { color: var(--maple-ivory); }
#toggle-ui-button:focus-visible, .link-button:focus-visible, #search-container input:focus-visible { outline: 2px solid var(--maple-gold); outline-offset: 2px; }
.menu-section { background: var(--maple-card); border: 1px solid var(--maple-border); }
.menu-section:hover { box-shadow: 0 0 9px rgba(112,29,40,.22); }
.menu-section h3 { color: var(--maple-gold); border-bottom-color: var(--maple-border); }
.ltg-brand { color: var(--maple-gold); }
.copyright-symbol { color: var(--maple-muted); }
.link-button { background: var(--maple-red); color: var(--maple-ivory); }
.link-button:hover { background: var(--maple-red-hover); color: var(--maple-ivory); }
.slider { background-color: #655A56; }
.slider:before { background: var(--maple-ivory); }
.switch:hover .slider { background-color: #85726A; }
input:checked+.slider { background-color: var(--maple-red); }
input:checked:hover+.slider { background-color: var(--maple-red-hover); }
#search-container input { background: rgba(36,25,25,.97); color: var(--maple-ivory); border: 1px solid var(--maple-border); box-shadow: 0 4px 15px rgba(0,0,0,.26); }
#search-container input::placeholder { color: var(--maple-muted); }
#search-container input:focus { background: var(--maple-panel); border: 1px solid var(--maple-gold); box-shadow: 0 0 10px rgba(112,29,40,.32); }
#search-container input:disabled { opacity: .6; cursor: not-allowed; }
.search-results { background: rgba(36,25,25,.98); border: 1px solid var(--maple-border); }
.search-results div { color: var(--maple-ivory); border-bottom-color: var(--maple-border); }
.search-results div:hover { color: var(--maple-ivory); background: var(--maple-red); }
.search-results::-webkit-scrollbar-track { background: rgba(245,238,219,.08); }
.search-results::-webkit-scrollbar-thumb, .search-results::-webkit-scrollbar-thumb:hover { background: var(--maple-red-hover); }
#player-info { background: rgba(36,25,25,.98); border: 1px solid var(--maple-border); color: var(--maple-ivory); }
#player-info h2, .player-info-label { color: var(--maple-gold); }
#player-info h2 { border-bottom-color: var(--maple-border); }
.close-btn { color: var(--maple-ivory); }
.close-btn:hover { color: var(--maple-gold); }
.player-avatar { border-color: var(--maple-gold); }
.following-marker { background-color: rgba(182,74,57,.25); border-color: var(--maple-gold); }
@media(max-width: 480px) {
  #ui-panel.open { width: min(240px, calc(100vw - 24px)); }
  #search-container input { width: 155px; box-sizing: border-box; }
  #player-info { width: min(300px, calc(100vw - 60px)); right: 10px; }
}

/* Maple Leaf — refined glass panels, transitions and card actions */
#ui-panel, #player-info, #search-container input, .search-results {
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
#ui-panel { transition: width .32s cubic-bezier(.22,1,.36,1), padding .32s ease, box-shadow .3s ease, border-color .3s ease; }
#ui-panel:hover { border-color: #A68064; }
.menu-section, .link-button { transition: transform .22s ease, background-color .22s ease, box-shadow .22s ease, border-color .22s ease; }
.menu-section:hover { transform: translateY(-1px); border-color: #A68064; }
.link-button:hover { transform: translateY(-2px); }
#toggle-ui-button { transition: color .2s ease, letter-spacing .2s ease; }
#toggle-ui-button:hover { color: #F2CD82; }
#player-info {
    display: block; visibility: hidden; opacity: 0; pointer-events: none;
    transform: translate(18px, -50%) scale(.98);
    transition: opacity .25s ease, transform .3s cubic-bezier(.22,1,.36,1), visibility .25s;
    width: min(330px, calc(100vw - 36px)); box-sizing: border-box;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.38), 0 0 0 1px rgba(245,238,219,.04) inset;
}
#player-info.active {
    display: block; visibility: visible; opacity: 1; pointer-events: auto;
    transform: translate(0, -50%);
}
#player-info h2 { overflow-wrap: anywhere; }
.player-avatar { width: 70px; height: 70px; }
.profile-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 20px; }
.profile-button, .profile-secondary {
    border-radius: 10px; padding: 11px 12px; font: 600 12px 'Segoe UI',Tahoma,sans-serif;
    text-align: center; text-decoration: none; cursor: pointer;
    transition: background .2s ease, transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.profile-button { background: #701D28; color: #F5EEDB; border: 1px solid #913742; }
.profile-button:hover { background: #8D2D3A; color: #fff; transform: translateY(-2px); box-shadow: 0 5px 18px rgba(112,29,40,.35); }
.profile-button[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.profile-secondary { background: #382823; border: 1px solid #78564C; color: #F5EEDB; }
.profile-secondary:hover { background: #4D332B; transform: translateY(-2px); }
.follow-hint { font-size: 11px; color: #C3A58C; margin-top: 12px; line-height: 1.5; }
.follow-hint.is-following { color: #F2CD82; }
#map-status {
    position: fixed; z-index: 12; left: 50%; top: 15px; transform: translateX(-50%);
    background: rgba(36,25,25,.93); color: #F5EEDB; border: 1px solid #78564C;
    box-shadow: 0 5px 20px rgba(0,0,0,.25); backdrop-filter: blur(12px);
    border-radius: 100px; display: flex; align-items: center; gap: 10px;
    padding: 8px 10px 8px 13px; font: 12px 'Segoe UI',Tahoma,sans-serif;
    white-space: nowrap;
}
.status-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #B64A39; box-shadow: 0 0 0 3px rgba(182,74,57,.16); animation: maplePulse 2.8s ease-in-out infinite; }
.status-title { font-weight: 800; letter-spacing: 1px; font-size: 10px; color: #F2CD82; }
.status-separator { height: 13px; width: 1px; background: #78564C; }
#visible-driver-count { color: #F5EEDB; font-variant-numeric: tabular-nums; }
#reset-map-view { background: rgba(112,29,40,.7); border: 1px solid #78564C; border-radius: 100px; color: #F5EEDB; padding: 6px 11px; cursor: pointer; font: inherit; transition: background .2s, transform .2s; }
#reset-map-view:hover { background: #87303B; transform: translateY(-1px); }
#reset-map-view:focus-visible, .profile-button:focus-visible, .profile-secondary:focus-visible { outline: 2px solid #F2CD82; outline-offset: 2px; }
@keyframes maplePulse { 50% { box-shadow: 0 0 0 6px rgba(182,74,57,0); } }
@media (max-width: 760px) { #map-status { top: 54px; font-size: 11px; } }
@media (max-width: 480px) {
 #map-status { gap: 6px; padding: 6px 8px; } #reset-map-view { padding: 5px 8px; }
 #player-info { right: 10px; width: min(330px, calc(100vw - 20px)); }
 .profile-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
 #player-info, #ui-panel, .menu-section, .profile-button, .profile-secondary, .link-button, #reset-map-view { transition: none !important; }
 .status-pulse { animation: none; }
}
