/* Moto Endurance Passport - Main Stylesheet */

:root {
    --primary-color: #c0392b;
    --secondary-color: #2563eb;
    --dark-color: #1a1a1a;
    --light-color: #f5f5f5;
    --success-color: #16a34a;
    --warning-color: #f59e0b;
    --danger-color: #dc2626;
    --text-color: #1a1a1a;
    --border-color: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--dark-color);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

header nav a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

header nav a:hover {
    color: var(--primary-color);
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.hero p {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Docs */
.docs-section {
    margin-bottom: 2rem;
}

.docs-section h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.docs-section h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.docs-section p {
    margin-bottom: 1rem;
}

.docs-section code {
    background-color: var(--light-color);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.docs-section pre {
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.docs-section pre code {
    background-color: transparent;
    padding: 0;
}

/* Error page */
.error-container {
    text-align: center;
    padding: 4rem 0;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.error-details {
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: 5px;
    margin: 2rem auto;
    max-width: 800px;
    text-align: left;
}

/* Footer — overridden by theme.css for light look */
footer {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Authentication Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.auth-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.auth-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control.error {
    border-color: var(--danger-color);
}

.error-message {
    display: block;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-hint {
    display: block;
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

/* Account Pages */
.account-container {
    max-width: 800px;
    margin: 0 auto;
}

.account-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.account-section h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--dark-color);
}

.info-value {
    color: #666;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Sprint 3 - Map */
.ride-map {
    height: 400px;
    min-height: 400px;
    width: 100%;
    z-index: 0;
    position: relative;
}
@media (min-width: 992px) {
    .ride-map {
        height: 560px;
        min-height: 560px;
    }
}

/* Sprint 3 - Ride Photos */
.ride-photo {
    height: 180px;
    object-fit: cover;
}

/* Sprint 3 - Challenge Cards */
.card .list-unstyled li {
    padding: 0.15rem 0;
}

/* Sprint 8 - Video */
#video-section .progress {
    border-radius: 12px;
    overflow: hidden;
}

#video-section .progress-bar {
    font-size: 0.8rem;
    font-weight: 600;
    transition: width 0.3s ease;
}

#video-section video {
    border: 1px solid var(--border-color);
}

#video-section .btn {
    min-width: 140px;
}

/* Sprint 9 - Variant Selectors */
.variant-selectors .form-select-sm {
    font-size: 0.85rem;
}

.variant-status {
    min-height: 1.2em;
    line-height: 1.4;
}

.product-card .card-footer {
    background: transparent;
    border-top: 1px solid #eee;
    padding: 0.75rem 1rem;
}

.product-card .card-body {
    padding-bottom: 0.5rem;
}

.product-price {
    font-size: 1.15rem;
    color: var(--text-color);
}

/* ══════════════════════════════════════════════════
   HOME PAGE - GUEST LANDING
   ══════════════════════════════════════════════════ */

.mep-hero {
    background: linear-gradient(135deg, #c0392b 0%, #a33025 50%, #8e2a20 100%);
    color: #fff;
    border-radius: 12px;
    margin: -1rem -12px 2rem -12px;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.mep-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.mep-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.mep-hero-inner {
    position: relative;
    z-index: 1;
}

.mep-hero-logo {
    max-height: 80px;
    max-width: 200px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.mep-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mep-hero-subtitle {
    font-size: 1.15rem;
    opacity: 0.85;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.5;
}

@media (max-width: 767.98px) {
    .mep-hero {
        padding: 2.5rem 1.5rem;
        margin: -1rem -12px 1.5rem -12px;
    }
    .mep-hero-title {
        font-size: 1.75rem;
    }
    .mep-hero-subtitle {
        font-size: 1rem;
    }
}

/* Step Cards */
.mep-step-card {
    background: #fff;
    border: none;
    border-radius: var(--mep-radius, 10px);
    padding: 2rem 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.mep-step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.mep-step-number {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(0,0,0,0.04);
    line-height: 1;
}

.mep-step-icon {
    font-size: 2.5rem;
    line-height: 1;
}

/* Stats Banner */
.mep-stats-banner {
    background: #fff;
    color: var(--text-color);
    border-radius: 12px;
    padding: 2rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.mep-stats-item {
    padding: 0.5rem;
}

.mep-stats-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--primary-color);
}

.mep-stats-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-color);
    opacity: 0.6;
    margin-top: 4px;
}

/* CTA Section */
.mep-cta {
    background: var(--light-color);
    border-radius: 12px;
    padding: 3rem 2rem;
}

/* ══════════════════════════════════════════════════
   GET THE APP - DOWNLOAD SECTION
   ══════════════════════════════════════════════════ */

.mep-download-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
}

.download-card {
    border-radius: 12px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.download-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Highlight Android card when on Android device */
.is-android .download-android {
    border: 2px solid var(--success-color) !important;
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.15);
}

/* Highlight iOS card when on iOS device */
.is-ios .download-ios {
    border: 2px solid var(--secondary-color) !important;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

/* Dim the other card on mobile devices */
.is-android .download-ios,
.is-ios .download-android {
    opacity: 0.7;
}

.is-android .download-ios:hover,
.is-ios .download-android:hover {
    opacity: 1;
}

/* ══════════════════════════════════════════════════
   HOME PAGE - SHARED COMPONENTS
   ══════════════════════════════════════════════════ */

/* Challenge card used on home page */
.mep-challenge-card {
    transition: transform 0.15s, box-shadow 0.15s;
    border-radius: 10px;
}

.mep-challenge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.mep-challenge-logo-sm {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #eee;
}

.min-width-0 {
    min-width: 0;
}

/* Ride card hover */
.mep-ride-card {
    transition: transform 0.15s, box-shadow 0.15s;
    border-radius: 8px;
}

.mep-ride-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ══════════════════════════════════════════════════
   MOBILE BOTTOM NAV (unified layout)
   ══════════════════════════════════════════════════ */

/* Always hidden by default; shown via d-lg-none Bootstrap class + CSS below */
.mep-mobile-bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1050;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.08);
}

.mep-mobile-bottomnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 0.65rem;
    padding: 6px 8px;
    transition: color 0.2s;
    line-height: 1.1;
}

.mep-mobile-bottomnav-item.active {
    color: var(--primary-color);
}

.mep-mobile-bottomnav-item:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.mep-mobile-bottomnav-icon {
    font-size: 1.3rem;
    line-height: 1;
    margin-bottom: 2px;
}

/* Bottom padding only when bottom nav is visible (mobile) */
@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    footer {
        margin-bottom: 64px;
    }
}

/* ═══════════════════════════════════════════════
   Native App Alignment Styles
   ═══════════════════════════════════════════════ */

/* Active ride highlight on ride list cards */
.mep-ride-active {
    background-color: #eef2ff;
}

/* Achievement card */
.mep-achievement-card {
    border-left: 4px solid var(--mep-green, #16a34a);
}

/* Photo lightbox trigger */
.mep-lightbox-trigger {
    transition: opacity 0.15s;
}
.mep-lightbox-trigger:hover {
    opacity: 0.85;
}

/* Lightbox modal dark backdrop */
#mepLightbox .modal-content {
    background-color: rgba(0, 0, 0, 0.95);
}
#mepLightbox .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}
/* Build 76 — pulse ring for the "Current location" marker on
   in-progress rides. The inner blue dot is solid; the outer ring
   pulses outward and fades, signalling "this is live, not the
   finish". Used by initRideMap in app.js when ride status is
   non-terminal. */
@keyframes mep-pulse {
    0%   { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}
