/* 
 * BikeJunkies Mobile-First Modern Cycling Aesthetic
 * Clean, mobile-first design for Mexican mountain bike community
 * Progressive enhancement from mobile to desktop
 */

:root {
    /* Modern Cycling Color Palette */
    --bj-primary: #2B7A0B;        /* Forest Green - Mountain/Nature */
    --bj-primary-light: #4CAF50;   /* Bright Green - Energy/Action */
    --bj-secondary: #FF6B35;       /* Sunset Orange - Adventure/Warmth */
    --bj-accent: #1976D2;          /* Sky Blue - Trust/Tech */
    --bj-dark: #263238;            /* Charcoal - Professional */
    --bj-light: #F8F9FA;          /* Clean White */
    --bj-gray: #546E7A;           /* Mountain Gray */
    --bj-success: #2E7D32;        /* Success Green */
    --bj-warning: #F57C00;        /* Warning Orange */
    --bj-danger: #D32F2F;         /* Alert Red */
    
    /* Typography */
    --bj-font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --bj-font-display: 'Inter', sans-serif;
    
    /* Shadows & Effects */
    --bj-shadow-sm: 0 2px 8px rgba(43, 122, 11, 0.08);
    --bj-shadow-md: 0 4px 16px rgba(43, 122, 11, 0.12);
    --bj-shadow-lg: 0 8px 32px rgba(43, 122, 11, 0.16);
    --bj-radius: 12px;
    --bj-radius-sm: 8px;
    --bj-radius-lg: 16px;
}

/* Override Bootstrap colors with cycling theme */
:root {
    --bs-primary: var(--bj-primary);
    --bs-primary-rgb: 43, 122, 11;
    --bs-secondary: var(--bj-secondary);
    --bs-secondary-rgb: 255, 107, 53;
    --bs-success: var(--bj-success);
    --bs-info: var(--bj-accent);
    --bs-warning: var(--bj-warning);
    --bs-danger: var(--bj-danger);
    --bs-light: var(--bj-light);
    --bs-dark: var(--bj-dark);
}

/* Mobile-First Base Typography */
body {
    font-family: var(--bj-font-primary);
    background-color: var(--bj-light);
    color: var(--bj-dark);
    line-height: 1.6;
    font-size: 16px; /* Base 16px for mobile */
    padding-bottom: 70px; /* Space for mobile bottom nav */
    overflow-x: hidden; /* Prevent horizontal scroll */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Desktop body adjustments */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

/* Mobile-first container with safe padding */
.container-fluid,
.container {
    padding-left: 16px;
    padding-right: 16px;
    max-width: 100%;
    overflow-x: hidden;
}

/* Desktop container adjustments */
@media (min-width: 768px) {
    .container-fluid,
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Touch Target Class - Minimum 44px for accessibility */
.tap-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(43, 122, 11, 0.2);
}

/* Mobile-First Hero Section - Fixed as background layer */
.hero-modern {
    background: linear-gradient(135deg, var(--bj-primary) 0%, var(--bj-primary-light) 50%, var(--bj-accent) 100%);
    height: 40vh; /* Fixed height instead of min-height */
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 2rem 0;
    text-align: center;
    z-index: 1; /* Background layer */
}

/* Desktop hero adjustments - Capped height */
@media (min-width: 768px) {
    .hero-modern {
        height: 50vh; /* Capped to prevent covering content */
        padding: 4rem 0;
    }
}

/* Smooth transition gradient at bottom of hero */
.hero-modern::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent 0%, rgba(248, 249, 250, 0.8) 70%, var(--bj-light) 100%);
    z-index: 2; /* Above background, below content */
    pointer-events: none;
}

@media (min-width: 768px) {
    .hero-modern::after {
        height: 120px;
    }
}

.hero-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(43, 122, 11, 0.1);
    opacity: 0.2;
    z-index: -1; /* Background layer behind content */
    pointer-events: none;
}

.hero-modern .container {
    position: relative;
    z-index: 10; /* Content layer on top */
}

.hero-title {
    font-family: var(--bj-font-display);
    font-weight: 800;
    font-size: 1.8rem; /* Mobile-first sizing */
    line-height: 1.2;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

/* Progressive enhancement for larger screens */
@media (min-width: 576px) {
    .hero-title {
        font-size: 2.2rem;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 2.8rem;
    }
}

@media (min-width: 992px) {
    .hero-title {
        font-size: 3.5rem;
        margin-bottom: 1.5rem;
    }
}

.hero-subtitle {
    font-size: 1rem; /* Mobile-first sizing */
    font-weight: 400;
    color: rgba(255,255,255,0.95);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    margin-bottom: 1.5rem;
    padding: 0 1rem;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

/* Progressive enhancement */
@media (min-width: 576px) {
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.2rem;
        padding: 0;
    }
}

@media (min-width: 992px) {
    .hero-subtitle {
        font-size: 1.4rem;
        margin-bottom: 2rem;
    }
}

/* Mobile-First Buttons */
.btn-modern {
    border-radius: var(--bj-radius-sm);
    font-weight: 600;
    padding: 0.875rem 1rem; /* Larger touch target */
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%; /* Full width on mobile */
    min-height: 48px; /* Touch-friendly */
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* Desktop button adjustments */
@media (min-width: 768px) {
    .btn-modern {
        width: auto;
        padding: 0.75rem 1.5rem;
        margin-bottom: 0;
        display: inline-flex;
    }
}

/* Large buttons remain full width on mobile */
.btn-lg.btn-modern {
    padding: 1rem 1.5rem;
    min-height: 52px;
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .btn-lg.btn-modern {
        padding: 1rem 2rem;
    }
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-primary.btn-modern {
    background: linear-gradient(135deg, var(--bj-primary) 0%, var(--bj-primary-light) 100%);
    color: white;
}

.btn-primary.btn-modern:hover {
    background: linear-gradient(135deg, var(--bj-primary-light) 0%, var(--bj-primary) 100%);
    transform: translateY(-2px);
    box-shadow: var(--bj-shadow-md);
}

.btn-secondary.btn-modern {
    background: linear-gradient(135deg, var(--bj-secondary) 0%, #FF8A65 100%);
    color: white;
}

.btn-outline-modern {
    border: 2px solid var(--bj-primary);
    color: var(--bj-primary);
    background: transparent;
}

.btn-outline-modern:hover {
    background: var(--bj-primary);
    color: white;
    transform: translateY(-2px);
}

/* Mobile-First Stats Section */
.stats-modern {
    background: linear-gradient(135deg, #ffffff 0%, var(--bj-light) 100%);
    border-radius: var(--bj-radius);
    padding: 1.5rem 1rem; /* Mobile padding */
    text-align: center;
    box-shadow: var(--bj-shadow-sm);
    margin-top: -20px; /* Reduced overlap on mobile */
    position: relative;
    z-index: 5;
    margin-left: 1rem;
    margin-right: 1rem;
}

/* Desktop stats adjustments */
@media (min-width: 768px) {
    .stats-modern {
        padding: 2rem 1.5rem;
        margin-top: -30px;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (min-width: 992px) {
    .stats-modern {
        padding: 3rem 2rem;
        margin-top: -40px;
    }
}

.stat-item {
    padding: 1rem;
}

.stat-number {
    font-size: 1.5rem; /* Mobile-first sizing */
    font-weight: 800;
    color: var(--bj-primary);
    display: block;
}

.stat-label {
    font-size: 0.75rem; /* Smaller on mobile */
    color: var(--bj-gray);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Desktop stat sizing */
@media (min-width: 576px) {
    .stat-number {
        font-size: 2rem;
    }
    .stat-label {
        font-size: 0.8rem;
        letter-spacing: 0.4px;
    }
}

@media (min-width: 768px) {
    .stat-number {
        font-size: 2.2rem;
    }
    .stat-label {
        font-size: 0.85rem;
    }
}

@media (min-width: 992px) {
    .stat-number {
        font-size: 2.5rem;
    }
    .stat-label {
        font-size: 0.9rem;
        letter-spacing: 0.5px;
    }
}

/* Mobile-First Navigation */
.navbar-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--bj-shadow-sm);
    padding: 0.75rem 0;
    overflow: visible !important;
}

.navbar-modern .container {
    overflow: visible !important;
}

.navbar-modern .navbar-nav {
    overflow: visible !important;
}

.navbar-brand-modern {
    font-family: var(--bj-font-display);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--bj-primary) !important;
    text-decoration: none;
}

.nav-link-modern {
    font-weight: 500;
    color: var(--bj-dark) !important;
    text-decoration: none !important;
    transition: color 0.3s ease, background-color 0.3s ease;
    padding: 0.75rem 1rem;
    border-radius: var(--bj-radius-sm);
    min-height: 44px;
    display: flex;
    align-items: center;
    border: none !important;
    background: transparent;
}

.nav-link-modern:focus,
.nav-link-modern:active {
    text-decoration: none !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(43, 122, 11, 0.2);
}

.nav-link-modern:hover {
    color: var(--bj-primary) !important;
    text-decoration: none !important;
    background: rgba(43, 122, 11, 0.05);
}

/* Desktop navigation adjustments */
@media (min-width: 768px) {
    .navbar-modern {
        padding: 1rem 0;
    }
    
    .navbar-brand-modern {
        font-size: 1.6rem;
    }
    
    .nav-link-modern {
        padding: 0.5rem 1rem;
    }
}

@media (min-width: 992px) {
    .navbar-brand-modern {
        font-size: 1.8rem;
    }
}

/* Mobile Navigation Utilities */
.mobile-nav-hidden {
    display: none !important;
}

@media (min-width: 768px) {
    .mobile-nav-hidden {
        display: block !important;
    }
    
    .mobile-only {
        display: none !important;
    }
}

/* Dropdown menu - allow scrolling for long menus */
.navbar-nav .dropdown-menu {
    margin-top: 0.25rem;
    min-width: 200px;
}

/* Dropdown items */
.navbar-nav .dropdown-menu .dropdown-item {
    white-space: nowrap;
    padding: 0.5rem 1rem;
}

.navbar-nav .dropdown {
    position: relative;
}

/* Footer Link Styling */
footer a.text-light:hover {
    opacity: 1 !important;
    color: var(--bj-primary) !important;
    transition: all 0.3s ease;
}

/* Mobile-First Feature Badges */
.feature-badge {
    background: linear-gradient(135deg, var(--bj-light) 0%, #ffffff 100%);
    border: 1px solid rgba(43, 122, 11, 0.1);
    border-radius: 20px;
    padding: 0.5rem 0.75rem; /* Slightly smaller on mobile */
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--bj-dark);
    display: inline-block;
    margin: 0.25rem 0.125rem;
    transition: all 0.3s ease;
    min-height: 32px;
    line-height: 1.2;
}

.feature-badge:hover {
    background: var(--bj-primary);
    color: white;
    transform: translateY(-1px); /* Reduced movement on mobile */
}

/* Desktop feature badge adjustments */
@media (min-width: 768px) {
    .feature-badge {
        border-radius: 25px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        margin: 0.25rem;
    }
    
    .feature-badge:hover {
        transform: translateY(-2px);
    }
}

/* Mobile-First Search */
.search-modern {
    background: white;
    border: 2px solid rgba(43, 122, 11, 0.1);
    border-radius: var(--bj-radius);
    padding: 0.875rem 1rem; /* Larger touch target */
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.search-modern:focus {
    border-color: var(--bj-primary);
    box-shadow: 0 0 0 0.2rem rgba(43, 122, 11, 0.15);
    outline: none;
}

/* Desktop search adjustments */
@media (min-width: 768px) {
    .search-modern {
        padding: 0.75rem 1rem;
    }
}

/* Mobile-First Cards */
.card-modern {
    background: white;
    border: none;
    border-radius: var(--bj-radius);
    box-shadow: var(--bj-shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-modern:hover {
    transform: translateY(-2px); /* Reduced on mobile */
    box-shadow: var(--bj-shadow-md);
}

.card-modern .card-header {
    background: linear-gradient(135deg, var(--bj-light) 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(43, 122, 11, 0.1);
    padding: 1rem; /* Mobile padding */
}

.card-modern .card-body {
    padding: 1rem; /* Mobile padding */
}

/* Desktop card adjustments */
@media (min-width: 768px) {
    .card-modern:hover {
        transform: translateY(-4px);
    }
    
    .card-modern .card-header {
        padding: 1.25rem;
    }
    
    .card-modern .card-body {
        padding: 1.25rem;
    }
}

@media (min-width: 992px) {
    .card-modern .card-header {
        padding: 1.5rem;
    }
    
    .card-modern .card-body {
        padding: 1.5rem;
    }
}

/* Featured Bikes Section - Horizontal Scrolling */
.featured-bikes-container {
    position: relative;
    margin: 0 -1rem; /* Full width on mobile */
    padding: 0 1rem;
    overflow: hidden;
}

.featured-bikes-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
}

.featured-bikes-scroll::-webkit-scrollbar {
    display: none; /* Webkit browsers */
}

.featured-bike-card {
    flex: 0 0 280px; /* Fixed width for consistent 16:9 ratio */
    scroll-snap-align: start;
    background: white;
    border-radius: var(--bj-radius);
    overflow: hidden;
    box-shadow: var(--bj-shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 44px; /* Touch target minimum */
}

.featured-bike-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--bj-shadow-md);
}

.featured-bike-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9; /* Perfect 16:9 ratio */
    overflow: hidden;
    background: var(--bj-light);
}

.bike-image-16-9 {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-bike-card:hover .bike-image-16-9 {
    transform: scale(1.05);
}

.featured-bike-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.placeholder-content {
    text-align: center;
    color: var(--bj-gray);
}

.photo-count-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.featured-bike-content {
    padding: 1rem;
}

.bike-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--bj-dark);
    /* Truncate long titles */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bike-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bj-primary);
    margin-bottom: 0.5rem;
}

.bike-location {
    font-size: 0.85rem;
    color: var(--bj-gray);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.scroll-indicator {
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Desktop featured bikes adjustments */
@media (min-width: 768px) {
    .featured-bikes-container {
        margin: 0; /* No negative margins on desktop */
        padding: 0;
    }
    
    .featured-bike-card {
        flex: 0 0 320px; /* Larger cards on desktop */
    }
    
    .featured-bike-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--bj-shadow-lg);
    }
}

/* Mobile Marketplace Grid */
.marketplace-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr; /* Single column on mobile */
}

/* Desktop grid - 2 columns */
@media (min-width: 576px) {
    .marketplace-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large desktop grid - 3 columns */
@media (min-width: 992px) {
    .marketplace-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile Marketplace Cards */
.marketplace-card-mobile {
    background: white;
    border-radius: var(--bj-radius);
    overflow: hidden;
    box-shadow: var(--bj-shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 44px; /* Touch target minimum */
    border: none;
}

.marketplace-card-mobile:hover {
    transform: translateY(-2px);
    box-shadow: var(--bj-shadow-md);
}

.marketplace-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9; /* Perfect 16:9 aspect ratio */
    overflow: hidden;
    background: var(--bj-light);
}

.marketplace-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* Loading state while lazy loading */
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.marketplace-image[loading="lazy"] {
    /* Additional styles for lazy loaded images */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.marketplace-image[loading="lazy"].loaded {
    opacity: 1;
}

.marketplace-card-mobile:hover .marketplace-image {
    transform: scale(1.05);
}

.marketplace-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.marketplace-photo-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 2;
}

.marketplace-type-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--bj-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
    z-index: 2;
}

.marketplace-content {
    padding: 1rem;
}

.marketplace-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--bj-dark);
    /* Truncate long titles */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.marketplace-subtitle {
    font-size: 0.9rem;
    color: var(--bj-gray);
    margin-bottom: 0.75rem;
}

.marketplace-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bj-primary);
    margin-bottom: 0.5rem;
}

.marketplace-location,
.marketplace-seller {
    font-size: 0.85rem;
    color: var(--bj-gray);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.marketplace-location:last-child,
.marketplace-seller:last-child {
    margin-bottom: 0;
}

/* Desktop marketplace card adjustments */
@media (min-width: 768px) {
    .marketplace-card-mobile:hover {
        transform: translateY(-4px);
        box-shadow: var(--bj-shadow-lg);
    }
    
    .marketplace-content {
        padding: 1.25rem;
    }
    
    .marketplace-title {
        font-size: 1.2rem;
    }
    
    .marketplace-price {
        font-size: 1.4rem;
    }
}

/* Legacy marketplace cards - keep for compatibility */
.marketplace-card {
    background: white;
    border-radius: var(--bj-radius);
    overflow: hidden;
    box-shadow: var(--bj-shadow-sm);
    transition: all 0.3s ease;
    border: none;
    margin-bottom: 1rem;
}

.marketplace-card:hover {
    transform: translateY(-2px); /* Reduced movement on mobile */
    box-shadow: var(--bj-shadow-md);
}

.marketplace-card img {
    height: 180px; /* Smaller on mobile */
    object-fit: cover;
    width: 100%;
    transition: transform 0.3s ease;
}

.marketplace-card:hover img {
    transform: scale(1.02); /* Subtle effect on mobile */
}

/* Desktop marketplace card adjustments */
@media (min-width: 576px) {
    .marketplace-card img {
        height: 200px;
    }
}

@media (min-width: 768px) {
    .marketplace-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--bj-shadow-lg);
    }
    
    .marketplace-card img {
        height: 220px;
    }
    
    .marketplace-card:hover img {
        transform: scale(1.05);
    }
}

@media (min-width: 992px) {
    .marketplace-card:hover {
        transform: translateY(-6px);
    }
}

.price-tag {
    background: var(--bj-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--bj-radius-sm);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Mobile-First Section Headers */
.section-header {
    font-family: var(--bj-font-display);
    font-weight: 700;
    color: var(--bj-dark);
    margin-bottom: 1.5rem;
    position: relative;
    font-size: 1.5rem;
    text-align: center;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, var(--bj-primary) 0%, var(--bj-secondary) 100%);
    border-radius: 2px;
}

/* Desktop section header adjustments */
@media (min-width: 768px) {
    .section-header {
        margin-bottom: 2rem;
        font-size: 1.75rem;
        text-align: left;
    }
    
    .section-header::after {
        left: 0;
        transform: none;
        width: 60px;
    }
}

@media (min-width: 992px) {
    .section-header {
        font-size: 2rem;
    }
}

/* Event Cards */
.event-card {
    background: white;
    border-left: 4px solid var(--bj-primary);
    border-radius: var(--bj-radius-sm);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--bj-shadow-sm);
    transition: all 0.3s ease;
}

.event-card:hover {
    border-left-color: var(--bj-secondary);
    transform: translateX(4px);
    box-shadow: var(--bj-shadow-md);
}

/* Mobile-First Grid System */
.row {
    margin-left: -8px;
    margin-right: -8px;
}

.col,
[class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
    margin-bottom: 1rem;
}

/* Desktop grid adjustments */
@media (min-width: 768px) {
    .row {
        margin-left: -15px;
        margin-right: -15px;
    }
    
    .col,
    [class*="col-"] {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Mobile-First Spacing Utilities */
.py-mobile {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.px-mobile {
    padding-left: 1rem;
    padding-right: 1rem;
}

.my-mobile {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.mx-mobile {
    margin-left: 1rem;
    margin-right: 1rem;
}

/* Desktop spacing adjustments */
@media (min-width: 768px) {
    .py-mobile {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .px-mobile {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .my-mobile {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .mx-mobile {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }
}

/* Mobile-First Text Alignment */
.text-center-mobile {
    text-align: center;
}

@media (min-width: 768px) {
    .text-start-md {
        text-align: left !important;
    }
    
    .text-end-md {
        text-align: right !important;
    }
}

/* Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* Community Features */
.community-highlight {
    background: linear-gradient(135deg, var(--bj-primary) 0%, var(--bj-accent) 100%);
    color: white;
    border-radius: var(--bj-radius);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.community-highlight::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Mobile-First Layout Utilities */
.mobile-container {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100%;
}

.mobile-full-width {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.mobile-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Mobile-First Safe Areas for modern devices */
.mobile-safe-bottom {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

/* Remove debug elements and clean up */
.debug-element,
.temp-element,
[style*="position:fixed"][style*="bottom:8px"] {
    display: none !important;
}

/* Emergency override to fix desktop overlay issue */
#splash, .hero, .hero::before, .hero::after, .full-cover, .veil, .backdrop {
    position: absolute !important;
    height: auto !important;
}

body { 
    overflow: auto !important; 
}

main, .content, #app, section:not(.hero-modern) { 
    position: relative; 
    z-index: 10; 
}

.logo, .brand-mark, .navbar-brand img { 
    position: static !important; 
    max-height: 32px !important;
    max-width: 32px !important;
    width: 32px !important;
    height: 32px !important;
}

/* Limit logo size but keep them visible */
img[src*="logo-bikejunkies"] {
    max-width: 32px !important;
    max-height: 32px !important;
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Mobile-First Form Elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: var(--bj-radius-sm);
    border: 2px solid rgba(43, 122, 11, 0.1);
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    border-color: var(--bj-primary);
    box-shadow: 0 0 0 0.2rem rgba(43, 122, 11, 0.15);
    outline: none;
}

/* Mobile-First Image Responsiveness */
img {
    max-width: 100%;
    height: auto;
}

.img-mobile-full {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Mobile-First Typography Scale */
h1, .h1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2, .h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.875rem;
}

h3, .h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

h4, .h4 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

h5, .h5 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

h6, .h6 {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* Desktop typography adjustments */
@media (min-width: 576px) {
    h1, .h1 { font-size: 2rem; }
    h2, .h2 { font-size: 1.75rem; }
    h3, .h3 { font-size: 1.5rem; }
}

@media (min-width: 768px) {
    h1, .h1 { font-size: 2.25rem; }
    h2, .h2 { font-size: 2rem; }
    h3, .h3 { font-size: 1.75rem; }
    h4, .h4 { font-size: 1.25rem; }
}

@media (min-width: 992px) {
    h1, .h1 { font-size: 2.5rem; }
    h2, .h2 { font-size: 2.25rem; }
    h3, .h3 { font-size: 2rem; }
    h4, .h4 { font-size: 1.5rem; }
    h5, .h5 { font-size: 1.125rem; }
}

/* Mobile Performance Optimizations */
@media (max-width: 767px) {
    /* Reduce animations on mobile for better performance */
    .card-modern,
    .btn-modern,
    .marketplace-card {
        transition: none;
    }
    
    /* Disable hover effects on touch devices */
    .card-modern:hover,
    .marketplace-card:hover {
        transform: none;
        box-shadow: var(--bj-shadow-sm);
    }
    
    .marketplace-card:hover img {
        transform: none;
    }
    
    .feature-badge:hover {
        transform: none;
        background: linear-gradient(135deg, var(--bj-light) 0%, #ffffff 100%);
        color: var(--bj-dark);
    }
}

/* ========================================
   ENHANCED RIDES MOBILE EXPERIENCE
   Phase 4 - Mobile-First Ride Components
   ======================================== */

/* Mobile-First Rides Grid */
.rides-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin: 0;
    padding: 0;
}

/* Progressive enhancement for larger screens */
@media (min-width: 576px) {
    .rides-grid {
        gap: 1.25rem;
    }
}

@media (min-width: 768px) {
    .rides-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 992px) {
    .rides-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Enhanced Ride Cards */
.ride-card {
    border: none;
    border-radius: var(--bj-radius);
    box-shadow: var(--bj-shadow-sm);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
    position: relative;
}

.ride-card:hover {
    box-shadow: var(--bj-shadow-md);
    transform: translateY(-2px);
}

/* Mobile-specific ride card adjustments */
@media (max-width: 767px) {
    .ride-card {
        transition: none;
        margin-bottom: 1rem;
    }
    
    .ride-card:hover {
        transform: none;
        box-shadow: var(--bj-shadow-sm);
    }
}

/* Ride Card Header */
.ride-card-header {
    background: linear-gradient(135deg, rgba(43, 122, 11, 0.02) 0%, rgba(43, 122, 11, 0.05) 100%);
    border-bottom: 1px solid rgba(43, 122, 11, 0.1);
}

.ride-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bj-dark);
    line-height: 1.3;
    margin: 0;
}

@media (min-width: 768px) {
    .ride-card-title {
        font-size: 1.2rem;
    }
}

.ride-organizer {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.ride-difficulty-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--bj-radius-sm);
}

/* Ride Detail Items */
.ride-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(43, 122, 11, 0.02);
    border-radius: var(--bj-radius-sm);
    border: 1px solid rgba(43, 122, 11, 0.1);
}

.ride-detail-content {
    min-width: 0;
    flex: 1;
}

.ride-detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bj-dark);
    line-height: 1.2;
}

.ride-detail-label {
    font-size: 0.75rem;
    line-height: 1;
}

/* Location Section */
.ride-location {
    padding: 0.75rem;
    background: rgba(25, 118, 210, 0.05);
    border-radius: var(--bj-radius-sm);
    border: 1px solid rgba(25, 118, 210, 0.1);
}

.ride-location-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bj-dark);
    line-height: 1.3;
}

/* Participants Badge */
.participants-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--bj-radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Ride View Button */
.ride-view-btn {
    border-radius: var(--bj-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
}

.ride-view-btn:hover {
    background: var(--bj-primary-light);
    transform: translateX(2px);
}

@media (max-width: 767px) {
    .ride-view-btn:hover {
        transform: none;
    }
}

/* ========================================
   MAP COMPONENTS
   ======================================== */

/* Collapsible Map Container */
.ride-map-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--bj-radius-sm);
    background: #f8f9fa;
    border: 1px solid rgba(43, 122, 11, 0.1);
}

.map-loading-state {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--bj-gray);
    z-index: 1;
}

.map-loading-state .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2em;
}

/* Leaflet map adjustments */
.ride-map-container .leaflet-container {
    border-radius: var(--bj-radius-sm);
    z-index: 2;
}

.ride-map-container .leaflet-popup-content {
    font-family: var(--bj-font-primary);
    color: var(--bj-dark);
}

.ride-map-container .leaflet-popup-content-wrapper {
    border-radius: var(--bj-radius-sm);
}

/* Map toggle button enhancements */
#mapToggleBtn {
    transition: all 0.2s ease;
    border-color: var(--bj-primary);
    color: var(--bj-primary);
}

#mapToggleBtn:hover {
    background: var(--bj-primary);
    color: white;
    transform: translateY(-1px);
}

#mapToggleBtn[aria-expanded="true"] {
    background: var(--bj-primary);
    color: white;
    border-color: var(--bj-primary);
}

@media (max-width: 767px) {
    #mapToggleBtn:hover {
        transform: none;
    }
}

/* ========================================
   STICKY MOBILE CTA
   ======================================== */

/* Mobile Sticky CTA Container */
.mobile-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: white;
    border-top: 1px solid rgba(43, 122, 11, 0.1);
    padding: 1rem;
    box-shadow: 0 -4px 16px rgba(43, 122, 11, 0.1);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Safe area support for iPhone */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-sticky-cta {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

/* Mobile CTA Button */
.mobile-cta-btn {
    border-radius: var(--bj-radius-sm);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
    min-height: 56px;
    border: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--bj-shadow-sm);
    text-transform: none;
    letter-spacing: 0;
}

.mobile-cta-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.mobile-cta-btn:active:before {
    left: 100%;
}

.mobile-cta-btn.btn-primary {
    background: linear-gradient(135deg, var(--bj-primary) 0%, var(--bj-primary-light) 100%);
    color: white;
}

.mobile-cta-btn.btn-primary:active {
    background: linear-gradient(135deg, var(--bj-primary-light) 0%, var(--bj-primary) 100%);
    transform: translateY(1px);
}

.mobile-cta-btn.btn-outline-danger {
    background: white;
    border: 2px solid var(--bj-danger);
    color: var(--bj-danger);
}

.mobile-cta-btn.btn-outline-danger:active {
    background: var(--bj-danger);
    color: white;
    transform: translateY(1px);
}

.mobile-cta-btn:disabled,
.mobile-cta-btn.btn-secondary {
    background: var(--bj-gray);
    color: white;
    cursor: not-allowed;
}

/* Hide desktop CTA buttons on mobile when sticky CTA is present */
@media (max-width: 767px) {
    .col-md-4 .btn-lg {
        display: none;
    }
}

/* ========================================
   RIDE DETAIL PAGE ENHANCEMENTS
   ======================================== */

/* Mobile-first ride detail adjustments */
@media (max-width: 767px) {
    .container.py-4 {
        padding-bottom: 5rem !important; /* Space for sticky CTA */
    }
    
    /* Ride header mobile adjustments */
    .col-md-8 h1 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .col-md-8 .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Card spacing on mobile */
    .card.mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Stats grid mobile optimization */
    .row.mt-4 .col-sm-6.col-lg-3 {
        margin-bottom: 1rem;
    }
    
    /* Participants sidebar on mobile */
    .col-md-4 .card {
        margin-top: 1rem;
    }
}

/* ========================================
   ENHANCED TOUCH INTERACTIONS
   ======================================== */

/* Touch-friendly tap targets */
.ride-card,
.ride-view-btn,
.mobile-cta-btn,
#mapToggleBtn {
    -webkit-tap-highlight-color: rgba(43, 122, 11, 0.2);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Enhanced active states for mobile */
@media (hover: none) and (pointer: coarse) {
    .ride-card:active {
        background: rgba(43, 122, 11, 0.02);
    }
    
    .ride-view-btn:active {
        background: var(--bj-primary-light);
        transform: scale(0.98);
    }
    
    #mapToggleBtn:active {
        background: var(--bj-primary);
        color: white;
        transform: scale(0.98);
    }
}

/* ========================================
   PHASE 6 - PHOTO UPLOAD INTERFACE
   ======================================== */

/* Photo Upload Container */
.photo-upload-container {
    margin-bottom: 1rem;
}

/* Photo Action Buttons - Ensure 44px minimum touch targets */
.photo-action-btn {
    min-height: 48px !important;
    min-width: 44px;
    border-radius: var(--bj-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: rgba(43, 122, 11, 0.2);
}

/* Primary photo action button (camera) */
.photo-action-btn.btn-primary {
    background: linear-gradient(135deg, var(--bj-primary) 0%, var(--bj-primary-light) 100%);
    color: white;
    border-color: var(--bj-primary);
}

.photo-action-btn.btn-primary:hover {
    background: linear-gradient(135deg, var(--bj-primary-light) 0%, var(--bj-primary) 100%);
    transform: translateY(-1px);
    box-shadow: var(--bj-shadow-md);
}

.photo-action-btn.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--bj-shadow-sm);
}

/* Outline photo action button (gallery) */
.photo-action-btn.btn-outline-primary {
    background: transparent;
    color: var(--bj-primary);
    border-color: var(--bj-primary);
}

.photo-action-btn.btn-outline-primary:hover {
    background: var(--bj-primary);
    color: white;
    transform: translateY(-1px);
}

.photo-action-btn.btn-outline-primary:active {
    transform: translateY(0);
}

/* Disabled state for photo action buttons */
.photo-action-btn:disabled {
    background: var(--bj-gray) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    border-color: var(--bj-gray) !important;
    cursor: not-allowed;
    transform: none !important;
}

/* Photo Upload Drop Zone */
.photo-upload-area {
    transition: all 0.3s ease;
    min-height: 120px;
    border-radius: var(--bj-radius) !important;
    background: rgba(38, 50, 56, 0.5) !important;
}

.photo-drop-zone {
    min-height: 80px;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: var(--bj-radius-sm);
    padding: 1rem;
}

.photo-drop-zone:hover {
    background: rgba(43, 122, 11, 0.05);
}

/* Photo Preview Container */
.photo-preview-container {
    border-radius: var(--bj-radius-sm);
    overflow: hidden;
    transition: all 0.3s ease;
}

.photo-preview-container:hover {
    transform: scale(1.02);
    box-shadow: var(--bj-shadow-md);
}

.photo-preview-img {
    transition: all 0.3s ease;
    border-radius: var(--bj-radius-sm) !important;
}

/* Photo Remove Button - Ensure 44px touch target */
.photo-remove-btn {
    top: 8px !important;
    right: 8px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: rgba(211, 47, 47, 0.9) !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease;
    z-index: 10;
    -webkit-tap-highlight-color: rgba(211, 47, 47, 0.2);
}

.photo-remove-btn:hover {
    background: var(--bj-danger) !important;
    transform: scale(1.1);
    box-shadow: var(--bj-shadow-md);
}

.photo-remove-btn:active {
    transform: scale(0.95);
}

/* Photo overlay with number */
.photo-overlay {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.photo-number {
    display: inline-block;
}

/* Upload Progress Indicator */
#upload-progress {
    background: rgba(43, 122, 11, 0.1);
    border-radius: var(--bj-radius-sm);
    padding: 1rem;
    text-align: center;
}

#upload-progress .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* Mobile Optimizations for Photo Upload */
@media (max-width: 767px) {
    .photo-action-btn {
        min-height: 52px !important;
        font-size: 1rem;
        padding: 1rem;
    }
    
    .photo-upload-area {
        min-height: 100px;
        padding: 1.5rem 1rem !important;
    }
    
    .photo-drop-zone {
        min-height: 60px;
        padding: 0.75rem;
    }
    
    .photo-preview-container img {
        height: 100px !important;
    }
    
    .photo-remove-btn {
        min-width: 40px !important;
        min-height: 40px !important;
        width: 40px !important;
        height: 40px !important;
        top: 6px !important;
        right: 6px !important;
    }
}

/* Large screen optimizations */
@media (min-width: 768px) {
    .photo-action-btn {
        min-height: 48px !important;
        font-size: 0.95rem;
    }
    
    .photo-upload-area {
        min-height: 140px;
    }
    
    .photo-drop-zone {
        min-height: 100px;
    }
}

/* Touch device specific enhancements */
@media (hover: none) and (pointer: coarse) {
    .photo-action-btn:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }
    
    .photo-remove-btn:active {
        transform: scale(0.9);
        transition: transform 0.1s ease;
    }
    
    .photo-preview-container:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Mobile Form Optimizations */
.mobile-form-label {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--bj-light);
}

.mobile-form-input {
    min-height: 48px !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    border-radius: var(--bj-radius-sm) !important;
    transition: all 0.3s ease;
    padding: 0.75rem 1rem !important;
}

.mobile-form-input:focus {
    border-color: var(--bj-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(43, 122, 11, 0.25) !important;
    background-color: rgba(38, 50, 56, 0.8) !important;
}

.mobile-form-textarea {
    min-height: 120px !important;
    font-size: 16px !important;
    border-radius: var(--bj-radius-sm) !important;
    transition: all 0.3s ease;
    padding: 0.75rem 1rem !important;
    resize: vertical;
    line-height: 1.5;
}

.mobile-form-textarea:focus {
    border-color: var(--bj-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(43, 122, 11, 0.25) !important;
    background-color: rgba(38, 50, 56, 0.8) !important;
}

.mobile-price-prefix {
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    font-size: 16px !important;
    font-weight: 600;
}

/* Mobile form spacing */
@media (max-width: 767px) {
    .mobile-form-label {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .mobile-form-input {
        min-height: 52px !important;
        font-size: 16px !important;
        padding: 1rem !important;
    }
    
    .mobile-form-textarea {
        min-height: 140px !important;
        font-size: 16px !important;
        padding: 1rem !important;
    }
    
    .mobile-price-prefix {
        min-height: 52px !important;
        font-size: 16px !important;
        padding: 1rem !important;
    }
    
    /* Additional mobile form spacing */
    .col-12, .col-6, .col-md-4, .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .form-text {
        margin-top: 0.5rem;
        font-size: 0.85rem;
    }
}

/* Desktop form optimizations */
@media (min-width: 768px) {
    .mobile-form-input {
        min-height: 44px !important;
        font-size: 0.95rem !important;
        padding: 0.6rem 0.75rem !important;
    }
    
    .mobile-form-textarea {
        min-height: 110px !important;
        font-size: 0.95rem !important;
        padding: 0.6rem 0.75rem !important;
    }
    
    .mobile-price-prefix {
        min-height: 44px !important;
        font-size: 0.95rem !important;
        padding: 0.6rem 0.75rem !important;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ride-card {
        border: 2px solid var(--bj-primary);
    }
    
    .ride-detail-item {
        border: 2px solid var(--bj-primary);
    }
    
    .mobile-cta-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ride-card,
    .ride-view-btn,
    .mobile-cta-btn,
    #mapToggleBtn {
        transition: none;
    }
    
    .mobile-cta-btn:before {
        display: none;
    }
}

/* Focus indicators for keyboard navigation */
.ride-view-btn:focus-visible,
.mobile-cta-btn:focus-visible,
#mapToggleBtn:focus-visible {
    outline: 3px solid var(--bj-primary);
    outline-offset: 2px;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* GPU acceleration for smooth animations */
.mobile-cta-btn,
.ride-card {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimize reflows on scroll */
.mobile-sticky-cta {
    contain: layout style paint;
}

/* ===== IMAGE PERFORMANCE OPTIMIZATIONS ===== */

/* Core image containers with proper aspect ratios */
.bike-image-container,
.marketplace-picture,
.main-image-container {
    display: block;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Optimized image loading with aspect ratio preservation */
.marketplace-image,
.bike-image-16-9,
.bike-listing-image,
.main-bike-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    background-color: var(--bj-gray);
    image-rendering: -webkit-optimize-contrast;
}

/* Progressive loading states */
.marketplace-image[style*="blur"],
.bike-image-16-9[style*="blur"],
.main-bike-image[style*="blur"] {
    filter: blur(5px);
    transform: scale(1.02);
}

.marketplace-image.loaded,
.bike-image-16-9.loaded,
.bike-listing-image.loaded,
.main-bike-image.loaded {
    filter: none !important;
    transform: scale(1) !important;
    opacity: 1 !important;
}

/* Mobile-first responsive images */
@media (max-width: 576px) {
    .marketplace-image,
    .bike-image-16-9,
    .main-bike-image {
        aspect-ratio: 4/3; /* Slightly taller on mobile for better visibility */
    }
    
    .marketplace-image-container,
    .featured-bike-image {
        aspect-ratio: 4/3;
    }
}

/* Performance optimizations for Core Web Vitals */
.marketplace-card-mobile,
.featured-bike-card {
    will-change: transform;
    contain: layout;
}

/* High-density display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .marketplace-image,
    .bike-image-16-9,
    .bike-listing-image,
    .main-bike-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

