:root {
    --green-dark: #2d5016;
    --green-mid: #4a7c29;
    --green-light: #6ba33e;
    --green-pale: #e8f5e1;
    --orange-accent: #e67e22;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.bg-dark-green {
    background-color: var(--green-dark) !important;
}

.btn-green {
    background-color: var(--green-mid);
    border-color: var(--green-mid);
    color: #fff;
}
.btn-green:hover {
    background-color: var(--green-dark);
    border-color: var(--green-dark);
    color: #fff;
}

.btn-outline-green {
    border-color: var(--green-mid);
    color: var(--green-mid);
}
.btn-outline-green:hover {
    background-color: var(--green-mid);
    color: #fff;
}

.text-green {
    color: var(--green-mid) !important;
}

.card-course {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}
.card-course:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-course .card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-course .badge-statut {
    position: absolute;
    top: 10px;
    right: 10px;
}

.card-course .course-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
}

.card-course .course-stats i {
    color: var(--green-mid);
    margin-right: 4px;
}

.hero-section {
    background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
    color: white;
    padding: 60px 0;
    margin-bottom: 30px;
}

.hero-section h1 {
    font-weight: 700;
    font-size: 2.5rem;
}

.auth-card {
    max-width: 450px;
    margin: 40px auto;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.auth-card .card-header {
    background: var(--green-mid);
    color: white;
    text-align: center;
    border-radius: 12px 12px 0 0 !important;
    padding: 20px;
}

#map {
    height: 500px;
    border-radius: 12px;
    z-index: 1;
}

#map-3d {
    display: none;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
}

.km-marker-label {
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    border: 1px solid #aaa;
    text-align: center;
    white-space: nowrap;
    line-height: 16px;
}

.km-marker {
    background: none !important;
    border: none !important;
}

.trace-tooltip {
    background: rgba(45, 80, 22, 0.92) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25) !important;
    pointer-events: none !important;
}

.trace-tooltip::before {
    border-top-color: rgba(45, 80, 22, 0.92) !important;
}

.elevation-wrapper {
    position: relative;
    height: 260px;
    width: 100%;
}

#elevation-chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.profil-header {
    background: linear-gradient(135deg, var(--green-dark), var(--green-light));
    color: white;
    padding: 40px 0;
    border-radius: 0 0 20px 20px;
}

.profil-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
}

.profil-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.course-detail-photo {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 12px;
}

.course-header-photo {
    width: 100%;
    height: 100%;
    min-height: 180px;
    max-height: 250px;
    object-fit: cover;
    border-radius: 12px 0 0 12px;
}

@media (max-width: 767.98px) {
    .course-header-photo {
        border-radius: 12px 12px 0 0;
        max-height: 200px;
    }
}

.stat-box {
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-box .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--green-mid);
}

.stat-box .stat-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
}

.no-photo-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--green-pale), #d4edda);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-mid);
    font-size: 3rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
    width: 100%;
    margin-bottom: 10px;
}

.oauth-btn-google {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
}
.oauth-btn-google:hover {
    background: #f5f5f5;
}

.oauth-btn-strava {
    background: #fc4c02;
    border: none;
    color: white;
}
.oauth-btn-strava:hover {
    background: #e04400;
    color: white;
}

.photo-dropzone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 12px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    background: #fafafa;
}

.photo-dropzone:hover {
    border-color: var(--green-mid);
    background: var(--green-pale);
}

.photo-dropzone-active {
    border-color: var(--green-mid);
    background: var(--green-pale);
    border-style: solid;
}

.photo-dropzone-content {
    text-align: center;
    padding: 20px;
}

.photo-preview {
    width: 100%;
    height: 100%;
    min-height: 180px;
    max-height: 220px;
    object-fit: cover;
    border-radius: 10px;
}

.photo-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.photo-remove-btn:hover {
    background: rgba(220,53,69,0.8);
}

.photo-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.8);
    border-radius: 10px;
}

.autocomplete-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--green-pale);
}

/* --- Mode Live --- */
.live-badge {
    animation: live-blink 1.2s ease-in-out infinite alternate;
}

@keyframes live-blink {
    from { opacity: 1; }
    to   { opacity: 0.55; }
}

/* Marqueur pulsant sur la carte 2D */
.live-marker-pulse {
    width: 20px;
    height: 20px;
    background: #dc3545;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    animation: live-pulse 1.6s ease-out infinite;
}

@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(220, 53, 69, 0.7); }
    70%  { box-shadow: 0 0 0 16px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0   rgba(220, 53, 69, 0); }
}

.live-message-item {
    font-size: 0.9rem;
}

/* --- Replay --- */
.replay-slider {
    flex: 1;
    min-width: 100px;
    max-width: 300px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #dee2e6;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.replay-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #dc3545;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    cursor: pointer;
}
.replay-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #dc3545;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    cursor: pointer;
}
