/* ================= GENERAL ================= */
    /* Global Styles */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333333;
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

/* Header */
header {
    position: sticky;
    background: #f4f8ff; /* White header */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    top: var(--top-bar-height, 34px); /* adjustable variable */
    z-index: 1000;      /* Keep it above other elements */
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;    /* Keeps image and text aligned */
    text-decoration: none;  /* Removes underline */
    cursor: pointer;        /* Makes it obvious it's clickable */
    transition: transform 0.2s ease; /* Smooth hover effect */
}

.logo a:hover img {
    transform: scale(1.05); /* Slight zoom */
}


/* Slight zoom on hover */
.logo a:hover {
    transform: scale(1.05); /* Makes it slightly bigger */
}

.logo a img:hover {
    filter: brightness(1.1); /* Slightly brighter on hover */
}

.logo img {
    height: 70px;
    width: 400px;
    margin-right: 10px;
}

.logo a span {
    color: #281a6c;         /* Keeps your logo text blue */
    transition: color 0.2s ease;
    margin-left: 8px;       /* Space between image and text */
}

.logo span {
    font-size: 1.8rem;
    font-weight: 750;
    color: #281a6c; /* Blue from logo */
}


nav a {
    color: #c23a2b; /* Red from logo */
    margin-left: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: #281a6c; /* Hover turns blue */
}


nav a[href*="tracking"] {
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(194, 58, 43, 0.1);
}
.btn,
.track-btn {
    box-shadow: 0 8px 20px rgba(194, 58, 43, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.track-btn:hover {
    transform: translateY(-2px);
}



/* ================= CONTAINER ================= */
.tracking-container {
    display: flex;
    height: calc(100vh - 90px); /* Full viewport minus header */
    gap: 20px;
    padding: 10px 20px;
}

/* ================= SIDEBAR ================= */
.sidebar {
    width: 300px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0px 0px 6px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.track-box {
    display: flex;
    flex-direction: column; /* Stack input-wrapper and helper text */
    gap: 3px;
}

.input-wrapper {
    display: flex; /* input + button inline */
    gap: 5px;      /* small space between input and button */
}

.track-box input {
    padding: 8px;
    font-size: 1rem;
    flex: 1; /* input expands, button stays fixed */
    box-sizing: border-box;
}

.track-box button {
    background-color: #0b2c4d; /* original blue */
    color: #fff;               /* white text */
    border: none;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;        /* optional, matches your site style */
    transition: background 0.3s;
}

.track-box small.helper-text {
    color: #555;
    font-size: 0.85rem;
}

.track-box button:hover {
    background-color: #09406b; /* slightly darker blue on hover */
}

.track-box small {
    display: block;
    margin-top: 5px;
    color: #555;
    font-size: 0.85rem;
}


.track-box small.helper-text {
    color: #555;
    font-size: 0.85rem;
}


.sidebar input#search {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

.vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vehicle-item {
    padding: 8px;
    border-radius: 4px;
    background: #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.vehicle-item:hover {
    background: #e0e0e0;
}

.loader {
    margin-top: 5px;
    font-size: 0.9rem;
    color: #0b2c4d;  /* blue color matching your theme */
    font-weight: bold;
}

.loader::before {
    content: "⏳ "; /* simple hourglass icon before text */
}

#sidebarLoader {
    margin-top: 5px;
    font-size: 0.9rem;
    color: #0b2c4d;  /* blue color */
    font-weight: bold;
}

#sidebarLoader::before {
    content: "";
    border: 3px solid #0b2c4d;
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-block;
    margin-right: 5px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}

/* ================= MAP ================= */
#map {
    flex: 1;
    border-radius: 8px;
}

/* ================= LOADER & ERROR ================= */
#loader, #error {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #fffbcc;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0px 0px 4px rgba(0,0,0,0.2);
    display: none;
}


/* =============== AUTO UPDATE ========================== */
.live-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.live-badge {
    font-size: 0.75rem;
    color: #1aa31a;
    font-weight: bold;
}

#pauseBtn {
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

#refreshRate {
    font-size: 0.8rem;
}

/* =========== ERROR ================== */
#error {
    display: none;
    color: #b30000;
    background: #ffe6e6;
    padding: 8px 12px;
    margin-top: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.toast {
    position: fixed;
    top: 90px; /* below header */
    right: 20px;
    background: #b30000;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.sidebar-toast {
    display: none;
    background: #b30000;
    color: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-top: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.sidebar-toast.show {
    display: block;
}

/* ===== Scroll Animations ===== */
.scroll-animate {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.show {
    opacity: 1;
    transform: translateY(0);
}

