/* ============================================================
   Mobile Optimizations — Yage-O Veins Trading
   Linked on every page — covers all global mobile concerns
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    min-width: 320px;
}

img { max-width: 100%; height: auto; }

@media screen and (-webkit-min-device-pixel-ratio: 0) {
    input, select, textarea { font-size: 16px !important; }
}

a, button, .btn, .service-card, .feature-card,
.tab-btn, .dropdown-item, .nav-links a, [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 214, 0, 0.2);
}

/* ============================================================
   NAVBAR — unified mobile for all pages <= 1024px
   ============================================================ */
@media (max-width: 1024px) {

    body { padding-top: 64px !important; }

    .navbar {
        position: fixed !important;
        top: 0 !important; left: 0 !important; right: 0 !important;
        width: 100% !important;
        height: 64px !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 0 16px !important;
        z-index: 2000 !important;
        background: #063366 !important;
    }

    .logo { flex: 1 1 auto; font-size: 1.1rem; justify-content: flex-start; }
    .logo img { height: 36px !important; width: 36px !important; }

    .hamburger {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 5px !important;
        margin-left: auto !important;
        z-index: 2001 !important;
        width: 40px !important; height: 40px !important;
        padding: 8px !important;
        border-radius: 8px !important;
        background: rgba(255,255,255,0.1) !important;
        cursor: pointer !important;
        transition: background 0.3s !important;
    }
    .hamburger:hover { background: rgba(255,255,255,0.2) !important; }
    .hamburger span {
        display: block !important;
        height: 3px !important; width: 24px !important;
        background: #fff !important;
        border-radius: 2px !important;
        transition: all 0.3s !important;
    }
    .hamburger.menu-open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px) !important; }
    .hamburger.menu-open span:nth-child(2) { opacity: 0 !important; }
    .hamburger.menu-open span:nth-child(3) { transform: rotate(-45deg) translate(7px,-6px) !important; }

    .nav-links {
        display: none !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 64px !important; left: 0 !important; right: 0 !important;
        width: 100% !important;
        background: rgba(6,51,102,0.97) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        z-index: 1999 !important;
        border-radius: 0 0 12px 12px !important;
        padding: 8px 0 24px !important;
        overflow-y: auto !important;
        max-height: calc(100vh - 64px) !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
        margin: 0 !important;
    }
    .nav-links.active { display: flex !important; }
    .nav-links li { width: 100% !important; border-bottom: 1px solid rgba(255,255,255,0.08) !important; }
    .nav-links li:last-child { border-bottom: none !important; }
    .nav-links a {
        display: flex !important; align-items: center !important;
        padding: 16px 24px !important;
        font-size: 1.05rem !important; font-weight: 500 !important;
        min-height: 52px !important;
        border-left: 4px solid transparent !important;
        transition: all 0.25s !important;
        border-radius: 0 !important;
        color: #fff !important;
    }
    .nav-links a:hover, .nav-links a.active {
        background: rgba(255,255,255,0.1) !important;
        border-left-color: #ffd600 !important;
        color: #ffd600 !important;
    }

    .close-btn { display: block !important; padding: 8px 24px 0 0 !important; text-align: right !important; border-bottom: none !important; }
    .close-btn button { background: none !important; border: none !important; font-size: 2rem !important; color: #fff !important; cursor: pointer !important; padding: 4px 8px !important; border-radius: 50% !important; }
    .close-btn button:hover { color: #ffd600 !important; }

    .dropdown-menu {
        position: static !important;
        background: rgba(255,255,255,0.06) !important;
        box-shadow: none !important; border: none !important;
        border-radius: 0 !important; padding: 0 !important;
    }
    .dropdown-menu a { padding: 12px 40px !important; font-size: 0.95rem !important; }

    .admin-link { border-top: 1px solid rgba(255,255,255,0.08) !important; }
    .admin-gear {
        width: 100% !important; justify-content: flex-start !important;
        border: none !important; border-radius: 0 !important;
        background: rgba(255,255,255,0.04) !important;
        padding: 16px 24px !important; font-size: 1.05rem !important;
        display: flex !important; align-items: center !important;
    }
    .admin-gear:hover { background: rgba(255,255,255,0.1) !important; transform: none !important; box-shadow: none !important; }
}

/* ============================================================
   HERO SECTIONS
   ============================================================ */
@media (max-width: 768px) {
    .contact-hero { padding: 50px 16px 30px !important; }
    .contact-hero h1 { font-size: 2rem !important; }
    .contact-hero p { font-size: 1rem !important; }

    .about-hero { padding: 50px 16px 30px !important; }
    .about-hero h1 { font-size: 2.2rem !important; }

    .hero-section { padding: 60px 16px 30px !important; min-height: 180px !important; }
    .hero-section h1 { font-size: 2rem !important; }
    .hero-section p { font-size: 1rem !important; }

    .hero-content h1 { font-size: 2.2rem !important; }
    .hero-content h2 { font-size: 1.2rem !important; }
}

@media (max-width: 480px) {
    .contact-hero h1 { font-size: 1.7rem !important; }
    .about-hero h1 { font-size: 1.7rem !important; }
    .hero-section h1 { font-size: 1.6rem !important; }
    .hero-content h1 { font-size: 1.8rem !important; }
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
@media (max-width: 768px) {
    .about-main { padding: 30px 16px !important; }
    .about-cards { grid-template-columns: 1fr !important; gap: 16px !important; }
    .team-section { padding: 40px 16px !important; }
    .team-cards { grid-template-columns: repeat(2,1fr) !important; gap: 16px !important; }
    .values-section { padding: 40px 16px !important; }
    .values-cards { grid-template-columns: 1fr !important; gap: 16px !important; }
    .about-card { padding: 20px 16px !important; }
    .value-card { padding: 20px 16px !important; }
}
@media (max-width: 480px) {
    .team-cards { grid-template-columns: 1fr !important; }
    .about-section h2 { font-size: 1.8rem !important; }
}

/* ============================================================
   SERVICES PAGE
   ============================================================ */
@media (max-width: 768px) {
    .services-section { padding: 40px 16px !important; }
    .services-header h1 { font-size: 2.2rem !important; }
    .service-category { padding: 24px 16px !important; margin-bottom: 40px !important; }
    .service-category-header { padding: 20px !important; gap: 12px !important; }
    .service-category-header h3 { font-size: 1.6rem !important; }
    .service-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
    .book-now-section { padding: 32px 16px !important; }
    .book-now-content h3 { font-size: 1.8rem !important; }
}
@media (max-width: 480px) {
    .services-header h1 { font-size: 1.8rem !important; }
    .service-category-header h3 { font-size: 1.4rem !important; }
}

/* ============================================================
   TRAINING PAGE
   ============================================================ */
@media (max-width: 768px) {
    .about-section { padding: 40px 16px !important; }
    .training-schedule-section { padding: 40px 16px !important; }
    .training-schedule-section h2 { font-size: 1.8rem !important; }
    .training-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
    .training-card { transform: none !important; }
    .training-card:hover { transform: none !important; }
    .filter-controls { flex-direction: column !important; align-items: stretch !important; }
    .filter-dropdowns { flex-wrap: wrap !important; justify-content: center !important; }
    .card-actions { flex-direction: column !important; gap: 8px !important; }
}
@media (max-width: 480px) {
    .filter-dropdowns select { width: 100% !important; }
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
@media (max-width: 900px) {
    .contact-container { flex-direction: column !important; padding: 0 16px !important; gap: 16px !important; align-items: stretch !important; }
    .contact-form-section, .contact-details-section { min-width: 0 !important; max-width: 100% !important; flex: none !important; }
}
@media (max-width: 480px) {
    .contact-form-section, .contact-details-section { padding: 18px 14px !important; }
}

/* ============================================================
   BOOK US NOW PAGE
   ============================================================ */
@media (max-width: 768px) {
    .booking-section { padding: 30px 0 !important; }
    .tab-navigation { flex-direction: column !important; align-items: center !important; gap: 10px !important; }
    .tab-btn { width: 100% !important; max-width: 320px !important; }
    .form-container { padding: 20px 16px !important; margin: 0 8px !important; border-radius: 12px !important; }
    .form-container h2 { font-size: 1.6rem !important; }
    .form-row { grid-template-columns: 1fr !important; gap: 14px !important; }
    .form-section { padding: 14px !important; }
    .form-actions { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
    .submit-btn, .reset-btn { width: 100% !important; }
}
@media (max-width: 480px) {
    .form-container { margin: 0 4px !important; padding: 16px 12px !important; }
    .form-container h2 { font-size: 1.4rem !important; }
}

/* ============================================================
   FOOTER — all pages
   ============================================================ */
@media (max-width: 768px) {
    footer .footer-content { flex-direction: column !important; gap: 24px !important; padding: 28px 16px !important; }
    footer .footer-about, footer .footer-links, footer .footer-social { width: 100% !important; min-width: 0 !important; }
    footer .footer-links ul { padding-left: 0 !important; }
}
@media (max-width: 480px) {
    footer .footer-content { padding: 20px 12px !important; }
    .footer-bottom { font-size: 0.82rem !important; padding: 12px 16px !important; }
}

/* ============================================================
   MODALS — all pages
   ============================================================ */
@media (max-width: 768px) {
    .modal { padding: 10px !important; }
    .modal-content { width: 95% !important; max-width: none !important; margin: 10px auto !important; padding: 20px !important; border-radius: 12px !important; max-height: calc(100vh - 20px) !important; overflow-y: auto !important; }
}

/* ============================================================
   FORMS — all pages
   ============================================================ */
@media (max-width: 768px) {
    .form-group input, .form-group select, .form-group textarea { font-size: 16px !important; padding: 12px 14px !important; border-radius: 8px !important; }
    .btn, button[type="submit"], .submit-btn { font-size: 1rem !important; padding: 13px 20px !important; min-height: 48px !important; border-radius: 8px !important; }
}

/* ============================================================
   HOME PAGE — stats, feature cards, briefs, countdown, waves
   ============================================================ */

/* --- Stats bar: 2×2 grid on mobile --- */
@media (max-width: 768px) {
    .stats-bar { flex-wrap: wrap !important; gap: 0 !important; padding: 0 !important; }
    .stat-item {
        flex: 1 1 50% !important;
        max-width: 50% !important;
        padding: 22px 12px !important;
        text-align: center !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    }
    .stat-icon { font-size: 1.6rem !important; margin-bottom: 8px !important; }
    .stat-number { font-size: 2.2rem !important; }
    .stat-label { font-size: 0.8rem !important; letter-spacing: 0.5px !important; }
}
@media (max-width: 480px) {
    .stat-item { padding: 18px 8px !important; }
    .stat-number { font-size: 2rem !important; }
    .stat-label { font-size: 0.75rem !important; }
}

/* --- Feature cards: single column, full-width on mobile --- */
@media (max-width: 768px) {
    .features {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 18px !important;
        padding: 0 16px !important;
    }
    .feature-card {
        width: 100% !important;
        max-width: 500px !important;
        min-width: 0 !important;
        height: 210px !important;
        min-height: unset !important;
    }
    .feature-card h3 { font-size: 1.6rem !important; }
    .feature-card p  { font-size: 1.05rem !important; }
}
@media (max-width: 480px) {
    .features { padding: 0 12px !important; gap: 14px !important; }
    .feature-card { height: 185px !important; }
    .feature-card h3 { font-size: 1.35rem !important; }
    .feature-card p  { font-size: 0.97rem !important; }
    .about-section h2 { font-size: 1.6rem !important; }
    .about-desc { font-size: 0.97rem !important; margin-bottom: 20px !important; padding: 0 4px !important; }
}

/* --- Brief cards (About Us / Services / Training snippets): full-width stack --- */
@media (max-width: 768px) {
    .home-briefs {
        flex-direction: column !important;
        align-items: center !important;
        padding: 36px 16px !important;
        gap: 18px !important;
    }
    .brief-card {
        width: 100% !important;
        max-width: 520px !important;
        min-width: 0 !important;
        flex: none !important;
        padding: 24px 20px 20px 20px !important;
    }
    .brief-card h2 { font-size: 1.25rem !important; margin-bottom: 10px !important; }
    .brief-card p  { font-size: 1rem !important; margin-bottom: 14px !important; }
}

/* --- Countdown section: tighter on small screens --- */
@media (max-width: 600px) {
    .countdown-section { padding: 28px 16px 32px !important; }
    #countdown-title { font-size: 1.5rem !important; line-height: 1.3 !important; }
    #countdown-meta  { font-size: 0.88rem !important; }
    .clock-digits    { font-size: 2.4rem !important; }
    .clock-label     { font-size: 0.68rem !important; }
}

/* --- Section wave SVGs: reduce height on mobile so gaps aren't huge --- */
@media (max-width: 600px) {
    .section-wave { line-height: 0 !important; }
    .section-wave svg { height: 36px !important; display: block !important; }
}

/* ============================================================
   TOAST MESSAGES — all pages
   ============================================================ */
.success-message, .error-message {
    position: fixed;
    top: 76px; left: 12px; right: 12px;
    z-index: 9000;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.95rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-width: none;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
#scroll-progress {
    position: fixed; top: 0; left: 0;
    height: 3px;
    background: #ffd600;
    z-index: 9999;
    transition: width 0.1s linear;
    pointer-events: none;
    border-radius: 0 2px 2px 0;
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
#back-to-top {
    position: fixed;
    bottom: 24px; right: 20px;
    z-index: 8000;
    background: #063366;
    color: #ffd600;
    border: 2px solid #ffd600;
    border-radius: 50%;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { transform: scale(1.1); background: #0a3970; }
#back-to-top:active { transform: scale(0.95); }

@media (max-width: 480px) {
    #back-to-top { bottom: 16px; right: 14px; width: 40px; height: 40px; }
}

/* ============================================================
   PREVENT OVERFLOW / SMALL SCREEN SAFETY NET
   ============================================================ */
@media (max-width: 480px) {
    .container, .contact-container, .services-container,
    .about-container, .training-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    h1, h2 { word-break: break-word; }
    p { overflow-wrap: break-word; }
}

/* ============================================================
   FLOATING ACTION BUTTONS
   ============================================================ */
.fab-container {
    position: fixed;
    bottom: 96px;
    right: 32px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.fab {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 18px rgba(0,0,0,0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
    position: relative;
}

.fab:hover {
    transform: scale(1.13);
    box-shadow: 0 8px 28px rgba(0,0,0,0.38);
}

.fab::after {
    content: attr(data-tip);
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15,25,50,0.88);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', Arial, sans-serif;
    padding: 5px 11px;
    border-radius: 7px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.fab:hover::after {
    opacity: 1;
}

.fab-whatsapp { background: #25d366; }
.fab-whatsapp:hover { background: #1ebe5a; }

.fab-facebook { background: #1877f2; }
.fab-facebook:hover { background: #1464d8; }

.fab-contact  { background: #1a3a6b; }
.fab-contact:hover  { background: #142e56; }

@media (max-width: 480px) {
    .fab-container { bottom: 70px; right: 14px; gap: 10px; }
    .fab { width: 48px; height: 48px; font-size: 1.2rem; }
    .fab::after { display: none; }
}

.fab svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    display: block;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .fab svg { width: 21px; height: 21px; }
}
