/* ============================================
   BIKE LOADING ANIMATION - FIXED & RESPONSIVE
   ============================================ */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #E8F0E3 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Bike Container */
.bike-loader {
    position: relative;
    width: 200px;
    height: 140px;
    animation: bike-bounce 2s ease-in-out infinite;
}

/* Bike Frame - Main structure */
.bike-frame {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 80px;
}

/* Top Tube (Horizontal bar connecting seat to handlebars) */
.bike-frame::before {
    content: '';
    position: absolute;
    width: 85px;
    height: 4px;
    background: #87A96B;
    border-radius: 2px;
    top: 20px;
    left: 15px;
    transform: rotate(-10deg);
}

/* Down Tube (Diagonal bar from handlebars down) */
.bike-frame::after {
    content: '';
    position: absolute;
    width: 75px;
    height: 4px;
    background: #87A96B;
    border-radius: 2px;
    top: 32px;
    left: 15px;
    transform: rotate(-40deg);
}

/* Seat Tube (Vertical bar under seat) */
.seat-tube {
    position: absolute;
    width: 4px;
    height: 50px;
    background: #87A96B;
    top: 8px;
    left: 90px;
    border-radius: 2px;
    z-index: 1;
}

/* Seat Post Connect (Small horizontal bar) */
.seat-tube::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 4px;
    background: #87A96B;
    border-radius: 2px;
    bottom: 0;
    left: 2px;
    transform: rotate(45deg);
}

/* Handlebars */
.handlebars {
    position: absolute;
    width: 28px;
    height: 18px;
    border: 4px solid #87A96B;
    border-bottom: none;
    border-radius: 25px 25px 0 0;
    top: 5px;
    left: 10px;
    z-index: 2;
}

/* Handlebar Stem */
.handlebars::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 20px;
    background: #87A96B;
    border-radius: 2px;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%) rotate(15deg);
}

/* Seat */
.seat {
    position: absolute;
    width: 24px;
    height: 10px;
    background: #6B8E5F;
    border-radius: 12px 12px 5px 5px;
    top: 3px;
    left: 83px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Pedal (rotating circle) */
.pedal {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #6B8E5F;
    border-radius: 50%;
    bottom: 26px;
    left: 75px;
    animation: pedal-rotate 1.2s linear infinite;
    transform-origin: center;
    z-index: 1;
}

/* Pedal arm indicator */
.pedal::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #A4C49A;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Front Wheel */
.front-wheel {
    position: absolute;
    width: 65px;
    height: 65px;
    border: 5px solid #87A96B;
    border-radius: 50%;
    bottom: 0;
    left: 8px;
    animation: spin 1.2s linear infinite;
    box-shadow: 0 2px 8px rgba(135, 169, 107, 0.3);
}

/* Front Wheel Spokes - Cross pattern */
.front-wheel::before,
.front-wheel::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: #A4C49A;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.front-wheel::after {
    transform: translateY(-50%) rotate(90deg);
}

/* Back Wheel */
.back-wheel {
    position: absolute;
    width: 65px;
    height: 65px;
    border: 5px solid #87A96B;
    border-radius: 50%;
    bottom: 0;
    right: 8px;
    animation: spin 1.2s linear infinite;
    box-shadow: 0 2px 8px rgba(135, 169, 107, 0.3);
}

/* Back Wheel Spokes - Cross pattern */
.back-wheel::before,
.back-wheel::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: #A4C49A;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.back-wheel::after {
    transform: translateY(-50%) rotate(90deg);
}

/* Wheel Hub (Center dot) */
.wheel-hub {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #6B8E5F;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Loading Text */
.loading-text {
    margin-top: 50px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #87A96B;
    letter-spacing: 0.05em;
    text-align: center;
}

/* Loading Dots */
.loading-dots {
    display: inline-block;
    margin-left: 5px;
}

.loading-dots span {
    display: inline-block;
    animation: dot-pulse 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Progress Bar */
.loading-progress {
    margin-top: 30px;
    width: 240px;
    height: 5px;
    background: rgba(135, 169, 107, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #87A96B 0%, #A4C49A 50%, #87A96B 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progress 2s ease-in-out infinite;
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Bike Bounce Animation */
@keyframes bike-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

/* Wheel Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Pedal Rotation */
@keyframes pedal-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Dot Pulse Animation */
@keyframes dot-pulse {
    0%, 80%, 100% {
        opacity: 0.3;
    }
    40% {
        opacity: 1;
    }
}

/* Progress Bar Animation */
@keyframes progress {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Fade In Animation for Content */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

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

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .bike-loader {
        width: 160px;
        height: 110px;
        /* Remove transform scale to prevent distortion */
    }
    
    .bike-frame {
        width: 130px;
        height: 65px;
        top: 32px;
    }
    
    .bike-frame::before {
        width: 70px;
        height: 3px;
        top: 16px;
        left: 12px;
    }
    
    .bike-frame::after {
        width: 60px;
        height: 3px;
        top: 26px;
        left: 12px;
    }
    
    .seat-tube {
        width: 3px;
        height: 40px;
        top: 6px;
        left: 72px;
    }
    
    .seat-tube::before {
        width: 24px;
        height: 3px;
    }
    
    .handlebars {
        width: 22px;
        height: 14px;
        border-width: 3px;
        top: 4px;
        left: 8px;
    }
    
    .handlebars::after {
        width: 3px;
        height: 16px;
    }
    
    .seat {
        width: 20px;
        height: 8px;
        top: 2px;
        left: 67px;
    }
    
    .pedal {
        width: 8px;
        height: 8px;
        bottom: 21px;
        left: 60px;
    }
    
    .pedal::after {
        width: 16px;
    }
    
    .front-wheel,
    .back-wheel {
        width: 52px;
        height: 52px;
        border-width: 4px;
    }
    
    .front-wheel {
        left: 6px;
    }
    
    .back-wheel {
        right: 6px;
    }
    
    .wheel-hub {
        width: 11px;
        height: 11px;
    }
    
    .loading-text {
        font-size: 1.125rem;
        margin-top: 40px;
    }
    
    .loading-progress {
        width: 180px;
        height: 4px;
        margin-top: 25px;
    }
}

@media (max-width: 480px) {
    .bike-loader {
        width: 140px;
        height: 100px;
    }
    
    .bike-frame {
        width: 110px;
        height: 55px;
        top: 28px;
    }
    
    .bike-frame::before {
        width: 60px;
        left: 10px;
    }
    
    .bike-frame::after {
        width: 50px;
        left: 10px;
    }
    
    .seat-tube {
        height: 35px;
        left: 62px;
    }
    
    .handlebars {
        width: 18px;
        height: 12px;
        left: 6px;
    }
    
    .seat {
        width: 16px;
        height: 7px;
        left: 58px;
    }
    
    .pedal {
        bottom: 18px;
        left: 52px;
    }
    
    .front-wheel,
    .back-wheel {
        width: 45px;
        height: 45px;
    }
    
    .front-wheel {
        left: 5px;
    }
    
    .back-wheel {
        right: 5px;
    }
    
    .loading-text {
        font-size: 1rem;
        margin-top: 35px;
    }
    
    .loading-progress {
        width: 150px;
    }
}
