/* ==========================================================================
   LIVE GPS TRACKER - HIGH-VISIBILITY OUTDOOR STYLES
   Optimized for outdoor sunlight, tablets, and field operations
   ========================================================================== */

.live-container {
    display: flex;
    height: calc(100vh - 65px);
    position: relative;
    overflow: hidden;
    background: #e2e8f0;
}

#map {
    flex: 1;
    height: 100%;
    width: 100%;
    background: #f1f5f9;
    z-index: 1;
}

/* Floating HUD Bar (Top Center) - Outdoor Sunlight Optimized */
.live-hud {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.65rem 2rem;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-top: 4px solid var(--tenant-primary);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.15);
}

body.theme-dark .live-hud {
    background: #0f1420;
    border-color: rgba(255, 255, 255, 0.15);
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-label {
    font-size: 0.76rem;
    font-family: var(--font-heading);
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

body.theme-dark .hud-label {
    color: var(--text-muted);
}

.hud-value {
    font-size: 1.6rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: #0f172a;
    line-height: 1.1;
}

body.theme-dark .hud-value {
    color: #ffffff;
}

.hud-value.highlight {
    color: var(--tenant-primary);
}

.hud-divider {
    width: 2px;
    height: 32px;
    background: #cbd5e1;
}

body.theme-dark .hud-divider {
    background: rgba(255, 255, 255, 0.12);
}

/* Side Panel (Left / Drawer) */
.live-sidebar {
    width: 400px;
    height: 100%;
    background: #ffffff;
    border-right: 2px solid #cbd5e1;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.06);
}

body.theme-dark .live-sidebar {
    background: #0d121c;
    border-right-color: rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    padding: 1.25rem 1.4rem;
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

body.theme-dark .sidebar-header {
    background: #0a0e17;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.sidebar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title-row h3 {
    font-size: 1.4rem;
    font-family: var(--font-heading);
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #0f172a;
}

body.theme-dark .sidebar-title-row h3 {
    color: #ffffff;
}

.search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    gap: 0.5rem;
}

body.theme-dark .search-box {
    background: #121826;
    border-color: rgba(255, 255, 255, 0.15);
}

.search-box input {
    background: transparent;
    border: none;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    outline: none;
    width: 100%;
}

body.theme-dark .search-box input {
    color: #ffffff;
}

.filter-pills {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.pill-btn {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: #334155;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 0.35rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

body.theme-dark .pill-btn {
    background: #121826;
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
}

.pill-btn:hover,
.pill-btn.active {
    background: var(--tenant-primary);
    color: #ffffff;
    border-color: var(--tenant-primary);
}

/* Athlete Cards in List */
.athlete-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: #f1f5f9;
}

body.theme-dark .athlete-list {
    background: #080b12;
}

.athlete-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 1rem 1.15rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    min-height: fit-content;
}

body.theme-dark .athlete-card {
    background: #0f1522;
    border-color: rgba(255, 255, 255, 0.1);
}

.athlete-card:hover,
.athlete-card.selected {
    border-color: var(--tenant-primary);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
    transform: translateX(3px);
}

.athlete-card.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--tenant-primary);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.bib-badge {
    background: #0f172a;
    border: 1px solid #000000;
    color: #ffffff;
    font-weight: 900;
    font-family: var(--font-heading);
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.card-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

body.theme-dark .card-name {
    color: #ffffff;
}

.card-club {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}

body.theme-dark .card-club {
    color: var(--text-dim);
}

.card-metrics {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.88rem;
    color: #1e293b;
    font-weight: 700;
}

body.theme-dark .card-metrics {
    border-top-color: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

/* Leaflet Custom Markers - Ultra-sharp contrast on OpenStreetMap */
.athlete-pin {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0f172a;
    border: 3px solid #dc2626;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.athlete-pin.pin-swim {
    border-color: #0284c7;
    background: #0369a1;
}

.athlete-pin.pin-bike {
    border-color: #d97706;
    background: #b45309;
}

.athlete-pin.pin-run {
    border-color: #dc2626;
    background: #b91c1c;
}

.athlete-pin:hover {
    transform: scale(1.35);
    z-index: 1000 !important;
}

/* Floating Athlete Details Card (Bottom Right) */
.athlete-detail-modal {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 370px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-top: 5px solid var(--tenant-primary);
    border-radius: 10px;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.2);
    padding: 1.5rem;
    z-index: 200;
    display: none;
    animation: fadeIn 0.25s ease;
}

body.theme-dark .athlete-detail-modal {
    background: #0e131d;
    border-color: rgba(255, 255, 255, 0.15);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.athlete-detail-modal.active {
    display: block;
}