/**
 * GoBook.ng - Mobile-First CSS Enhancements
 * Optimized touch interactions, smooth animations, and mobile-specific improvements
 * Compatible with Airbnb-style homepage design
 */

/* ==================== MOBILE-FIRST IMPROVEMENTS ==================== */

/* Smoother scrolling on iOS */
html {
    -webkit-overflow-scrolling: touch;
}

/* Remove default iOS styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ==================== LOADING STATES ==================== */

/* Skeleton loading animation */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #e0e0e0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== SCROLL ENHANCEMENTS ==================== */

/* Smooth momentum scrolling */
.scroll-row,
.cities-scroll {
    -webkit-overflow-scrolling: touch;
}

/* ==================== SAFE AREA HANDLING (iPhone notch) ==================== */

@supports (padding: max(0px)) {
    .header {
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .mobile-bottom-nav {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .simple-search-container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* ==================== TOAST NOTIFICATIONS ==================== */

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 16px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 90%;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.toast.error {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.toast.info {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

/* ==================== PARALLAX SCROLL EFFECT ==================== */

@media (max-width: 768px) {
    .parallax-scroll {
        transform: translateZ(0);
        will-change: transform;
    }
}

/* ==================== BOTTOM NAVIGATION INDICATOR ==================== */

.mobile-bottom-nav .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: #FF385C;
    border-radius: 2px 2px 0 0;
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */

/* GPU acceleration for smooth animations */
.mobile-bottom-nav .nav-item {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== ACCESSIBILITY ENHANCEMENTS ==================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #FF385C;
    outline-offset: 2px;
}

/* Remove outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ==================== PRINT STYLES ==================== */

@media print {
    .mobile-bottom-nav,
    #pull-refresh-indicator,
    #scroll-progress,
    #offline-indicator {
        display: none !important;
    }
}