/* overa.css */
.overa-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.overa-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
}

.overa-label {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text, #1e293b);
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}

.overa-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: var(--bg, #f8fafc);
    color: var(--text, #1e293b);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: all 0.3s ease;
}

.overa-input:focus {
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.overa-btn-outline {
    width: 100%;
    padding: 14px;
    border: 2px dashed rgba(59, 130, 246, 0.5);
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.02);
    color: var(--primary, #3b82f6);
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.overa-btn-outline:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary, #3b82f6);
    transform: translateY(-1px);
}

.overa-btn-outline:active {
    background: rgba(59, 130, 246, 0.15);
    transform: translateY(1px);
}

.overa-btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.overa-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.5);
}

.overa-btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.overa-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Ride Card (The exportable image) */
.overa-preview-container {
    width: 100%;
    /* 9:16 Aspect Ratio is standard for IG Stories, WA Status, and Reels */
    aspect-ratio: 9/16;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #0f172a;
    border: 2px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.overa-floating-download {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #64748b;
    color: rgba(255, 255, 255, 0.5);
    border: none;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.overa-floating-download.visible {
    background: #3b82f6;
    color: white;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    animation: glow-pulse 2s infinite;
}

.overa-floating-download:active {
    transform: scale(0.9);
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}


/* ================================
   OVERA RIDE CARD — Strava Layout
   ================================ */

.overa-ride-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0f1a;
    overflow: hidden;
    color: white;
    font-family: 'Outfit', system-ui, sans-serif;
    display: flex;
    flex-direction: column;
}

/* Background photo */
.overa-photo-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.overa-photo-layer.has-photo {
    opacity: 1;
}

/* Dark tint overlay on top of photo */
.overa-tint-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    background: rgba(10, 15, 26, 0.62);
    pointer-events: none;
}

/* Centered OVERA wordmark */
.overa-wordmark {
    text-align: center;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Stats area: top 60% of card */
.overa-stats-top {
    position: relative;
    z-index: 4;
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 24px 16px;
    background: transparent;
}

/* Brand row at top */
.overa-brand-top {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.overa-brand-text { color: #fff; }
.overa-brand-dot { color: rgba(255,255,255,0.4); }
.overa-trip-date { font-weight: 500; letter-spacing: 0.5px; font-size: 0.7rem; }

/* Vehicle name */
.overa-card-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 16px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Thin divider line */
.overa-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
    margin-bottom: 20px;
}

/* Hero stat: Distance */
.overa-stat-hero {
    text-align: center;
    margin-bottom: 20px;
}

.overa-stat-hero-lbl {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
}

.overa-stat-hero-val {
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
    letter-spacing: -2px;
}

.overa-stat-hero-val small {
    font-size: 1.4rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 4px;
    letter-spacing: 0;
}

/* Secondary stats row */
.overa-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0;
}

.overa-stat-item {
    flex: 1;
    text-align: center;
}

.overa-stat-divider-v {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.overa-stat-item-lbl {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 3px;
}

.overa-stat-item-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.overa-stat-item-val small {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 2px;
}

/* Map area: bottom 40% of card */
.overa-map-area {
    position: relative;
    z-index: 3;
    flex: 1;
    overflow: hidden;
}

.overa-map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: transparent !important;
    pointer-events: none !important;
}

.overa-map.leaflet-container {
    background: transparent !important;
}

/* Fade from stats into map area */
.overa-map-top-fade {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(10, 15, 26, 0.85) 0%, rgba(10, 15, 26, 0) 100%);
    pointer-events: none;
}

/* Footer brand */
.overa-footer-brand {
    position: relative;
    z-index: 4;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 0 10px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(10, 15, 26, 0.7);
}

/* ================================
   Legacy classes (kept for compat)
   ================================ */
.overa-gradient-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0) 60%, rgba(15, 23, 42, 0.95) 100%);
    pointer-events: none;
}

.overa-brand {
    position: absolute;
    top: 20px; left: 0; right: 0;
    text-align: center; z-index: 4;
    font-weight: 800; font-size: 0.85rem;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.overa-stats-container {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 4;
    padding: 60px 16px 36px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
}

.overa-stats-grid { display: flex; justify-content: space-around; align-items: center; width: 100%; }
.overa-stat-box { display: flex; flex-direction: column; align-items: center; text-align: center; }
.overa-stat-val { font-size: 1.3rem; font-weight: 800; line-height: 1.2; margin-bottom: 2px; color: #ffffff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }
.overa-stat-val small { font-size: 0.75rem; font-weight: 500; color: #94a3b8; margin-left: 2px; }
.overa-stat-lbl { font-size: 0.65rem; font-weight: 600; color: #cbd5e1; letter-spacing: 0.05em; text-transform: uppercase; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }

/* ================================
   Loading Overlay
   ================================ */
#overa-loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 15, 26, 0.92);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#overa-loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================
   Animations
   ================================ */
.overa-path-anim { animation: overaFadeIn 1.5s ease-out forwards; }
.overa-marker-anim { animation: overaPopIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; transform-origin: bottom center; }

@keyframes overaFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes overaPopIn {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}