/* ========================================
   WebRide - App Styles
   ======================================== */

/* Google Fonts & Icons */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap");
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css");

/* ---- Base ---- */
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #FFFFFF;
}

html {
    scroll-behavior: smooth;
}

/* ---- Dropdown ---- */
.dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.dropdown > button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 5px 0;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 90px !important;
    padding-top: 10px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease-in-out;
    z-index: 999;
}

.dropdown:hover .dropdown-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-content {
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3) !important;
    border: 1px solid #e2e8f0 !important;
    padding: 5px !important;
    display: block !important;
}

.dropdown-content a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    color: #1e293b !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: #f1f5f9 !important;
    color: var(--brand-500, #2563eb) !important;
}

.dropdown img,
.dropdown-content img {
    width: 18px !important;
    height: 12px !important;
    object-fit: cover !important;
    border-radius: 2px !important;
    display: inline-block !important;
}

.dropdown i {
    font-size: 9px !important;
    opacity: 0.7;
}

/* ---- Utility Classes ---- */
.soft-shadow { box-shadow: 0 20px 50px -15px rgba(0,0,0,0.05); }
.hero-gradient { background: radial-gradient(circle at 0% 0%, #f8faff 0%, #ffffff 100%); }

/* ---- FAQ ---- */
.faq-answer { display: none; }
.faq-item.active .faq-answer { display: block; }

/* ---- Slider ---- */
.slide.active { opacity: 1; z-index: 20; }
.slide.active .slide-tag,
.slide.active .slide-title,
.slide.active .slide-desc,
.slide.active .slide-btn { opacity: 1; transform: translateY(0); }

@keyframes scroll-line {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}
.animate-scroll-line { animation: scroll-line 2s infinite cubic-bezier(1, 0, 0, 1); }

/* ---- Desktop Header Menu ---- */
@media (min-width: 1024px) {
    .header-menu-container > ul {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        list-style: none;
    }
    .header-menu-container li { position: relative; }
    .header-menu-container li a {
        text-decoration: none;
        font-weight: 800;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        padding: 10px 0;
        display: block;
        transition: all 0.3s ease;
    }
    .header-menu-container li:hover > a {
        color: var(--brand-500, #2563eb);
    }
    .header-menu-container > ul li ul.sub-menu {
        position: absolute;
        top: 100%;
        left: -1rem;
        min-width: 220px;
        background: white;
        padding: 1rem;
        border-radius: 1.5rem;
        box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        z-index: 100;
        border: 1px solid #f1f5f9;
        list-style: none;
    }
    .header-menu-container li:hover > ul.sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .header-menu-container > ul > li ul.sub-menu li a {
        padding: 8px 15px;
        font-size: 10px;
        color: #64748b;
        border-radius: 0.75rem;
    }
    .header-menu-container > ul > li ul.sub-menu li a:hover {
        background: #f8fafc;
        color: var(--brand-500, #2563eb);
        padding-left: 20px;
    }
}

/* ---- Mobile Menu ---- */
#mobile-menu {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 100vh;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#mobile-menu.active { transform: translateX(0); }
#mobile-menu::-webkit-scrollbar { width: 4px; }
#mobile-menu::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

#mobile-menu ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
#mobile-menu li a {
    font-size: 1.5rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    color: #0f172a;
    display: block;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.5rem;
}
#mobile-menu ul.sub-menu {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
    gap: 0.5rem;
    border-left: 2px solid var(--brand-500, #2563eb);
}
#mobile-menu ul.sub-menu li a {
    font-size: 1rem;
    color: #64748b;
    border: none;
    padding-bottom: 0.2rem;
}

/* ---- Booking Widget ---- */
.ride-and-go-widget {
    background: #ffffff;
    min-height: 280px;
    overflow: visible;
}

@media (min-width: 768px) {
    .ride-and-go-widget { min-height: 450px; }
}

rideandgoo-booking {
    display: block;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

/* Widget internal elements - no forced radius on mobile */
@media (min-width: 768px) {
    .ride-and-go-widget iframe,
    .ride-and-go-widget div {
        border-radius: 2.8rem !important;
    }
}

/* Ensure widget shadow host doesn't clip content */
rideandgoo-booking,
rideandgoo-booking * {
    box-sizing: border-box;
}

/* ---- Section Background ---- */
section {
    background-image: radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.03) 0, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(37, 99, 235, 0.03) 0, transparent 50%);
}

/* ---- Cookie Banner ---- */
.cookie-container {
    position: fixed;
    z-index: 999999;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    display: none;
    pointer-events: none;
}
.cookie-container.is-visible { display: block; }
.cookie-container.hide { opacity: 0; transform: translateY(40px); }

.cookie-card {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 24px;
    border-radius: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin-left: auto;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.cookie-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}
.cookie-icon {
    width: 44px;
    height: 44px;
    background: #eff6ff;
    color: var(--brand-500, #2563eb);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.cookie-text h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    font-style: italic;
    color: #1e293b;
    letter-spacing: -0.02em;
}
.cookie-text p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
    font-weight: 500;
}
.cookie-btn {
    width: 100%;
    background: #1e293b;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.cookie-btn:hover {
    background: var(--brand-500, #2563eb);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

@media (max-width: 768px) {
    .cookie-container { padding: 16px; }
    .cookie-card { max-width: 100%; margin-left: 0; border-radius: 24px; padding: 20px; }
    .cookie-text p { font-size: 11px; }
}

/* ---- Transfer Loader ---- */
#global-transfer-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999999;
    transition: opacity 0.5s ease, visibility 0.5s;
}
.loader-wrapper { width: 280px; text-align: center; position: relative; }
.road-line { width: 100%; height: 2px; background: #e0e0e0; position: relative; margin-top: 40px; }
.moving-vehicle {
    position: absolute;
    bottom: 5px;
    left: 0;
    font-size: 2.5rem;
    color: #f39c12;
    animation: transferTravel 2.5s infinite linear;
}
.point { position: absolute; bottom: -5px; width: 10px; height: 10px; background: #34495e; border-radius: 50%; }
.point-a { left: 0; }
.point-b { right: 0; }
.loading-text {
    margin-top: 30px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #2c3e50;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 13px;
    animation: pulseText 1.5s infinite;
}
.loader-fade-out { opacity: 0; visibility: hidden; }

@keyframes transferTravel {
    0% { left: 0%; transform: scaleX(1); }
    45% { transform: scaleX(1); }
    50% { left: 85%; transform: scaleX(-1); }
    95% { transform: scaleX(-1); }
    100% { left: 0%; transform: scaleX(1); }
}
@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ---- Route Cards ---- */
.route-card {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.route-card:hover { transform: translateY(-2px); }
.route-card:active { transform: scale(0.98); }
.route-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(37, 99, 235, 0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: inherit;
}
.route-card:active::after { opacity: 1; }
.route-card.loading { pointer-events: none; opacity: 0.7; }
.route-card.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--brand-500, #2563eb);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    .route-card { border-radius: 1rem; }
    .route-card .p-4 { padding: 1rem; }
}

/* ---- Line Clamp Utility ---- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Global Mobile Improvements ---- */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

@media (max-width: 767px) {
    /* Ensure images never overflow */
    img { max-width: 100%; height: auto; }
    
    /* Ensure iframes never overflow */
    iframe { max-width: 100% !important; }
    
    /* Smoother touch scrolling */
    * { -webkit-tap-highlight-color: transparent; }
    
    /* Fix for tables that might overflow */
    table { word-break: break-word; }
    
    /* Container safety */
    .container { max-width: 100% !important; overflow-x: hidden; }
    
    /* Widget section - prevent any content clipping */
    .ride-and-go-widget,
    .ride-and-go-widget * {
        max-width: 100% !important;
    }
    
    /* Section overflow control */
    section { overflow-x: hidden; }
}
