/* ==============================================================
   HẢI VÂN AD - Core Web Design System & Modern Typography
   Primary Font: Montserrat (Headings) & Plus Jakarta Sans (Body)
   ============================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600;1,700&family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600;1,700&display=swap');

:root {
    --brand-red: #e11d48;
    --brand-red-dark: #be123c;
    --brand-red-light: #ffe4e6;
    --brand-dark: #0f172a;
    --brand-slate: #1e293b;
    --brand-gold: #f59e0b;
    --brand-sky: #0ea5e9;
    --brand-emerald: #10b981;
    --brand-bg: #f8fafc;

    /* Google Font: Montserrat for Headings (100% Vietnamese Native Diacritics), Plus Jakarta Sans for Body */
    --font-heading: 'Montserrat', system-ui, -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-quote: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-accent: 'Montserrat', system-ui, -apple-system, sans-serif;
    --font-main: var(--font-body);
}

/* Explicit Utility Classes */
.font-jakarta { font-family: 'Plus Jakarta Sans', sans-serif !important; }
.font-montserrat { font-family: 'Montserrat', sans-serif !important; }
.font-outfit { font-family: 'Outfit', sans-serif !important; }

/* Backward Compatibility Utility Classes */
.font-avo, .font-helve, .font-centur, .font-center { font-family: 'Montserrat', sans-serif !important; }

/* Functional Semantic Classes */
.font-heading { font-family: var(--font-heading) !important; }
.font-body { font-family: var(--font-body) !important; }
.font-quote { font-family: var(--font-quote) !important; }
.font-accent { font-family: var(--font-accent) !important; }

html {
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--brand-bg);
    color: #334155;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Mobile Devices: Revert to native overlay touch scrolling (no reserved desktop scrollbar gutter) */
@media (max-width: 1023px) {
    html {
        overflow-y: auto !important;
        scrollbar-gutter: auto !important;
    }
    body {
        overflow-x: hidden !important;
    }
}

section {
    contain: paint;
}

/* Headings use UTM Helve */
:where(h1, h2, h3, h4, h5, h6, .hero-title, .brand-title, .section-title, .card-title) {
    font-family: var(--font-heading);
    letter-spacing: -0.015em;
    font-weight: 700;
    line-height: 1.35;
    color: var(--brand-dark);
}

/* Quotes, Testimonials, Trích dẫn use UTM Centur */
:where(blockquote, q, cite, .quote-box, .quote-text, .testimonial-text, .trich-dan, .quote-font) {
    font-family: var(--font-quote);
    font-style: italic;
    letter-spacing: 0.01em;
}
blockquote {
    border-left: 3px solid var(--brand-red);
    padding-left: 1rem;
}

/* Eyebrows, Badges, Category pills & Highlights use UTM Centur */
.badge-pill, .tag-pill, .eyebrow-badge, [class*="badge"], .counter-val {
    font-family: var(--font-accent);
}
h1 { line-height: 1.3; }
h2 { line-height: 1.35; }
h3 { line-height: 1.4; }

/* Crisp high contrast for dark sections and hero headers */
.dark-banner h1, .dark-banner h2,
#hero h1, #hero h2,
.hero-banner h1, .hero-banner h2,
.text-white > h1, .text-white > h2 {
    color: #ffffff !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

/* Ensure text inside white cards/containers retains dark crisp contrast */
.bg-white :is(h1, h2, h3, h4, h5, h6):not(.text-white),
.card-soft :is(h1, h2, h3, h4, h5, h6):not(.text-white) {
    color: var(--brand-dark) !important;
    text-shadow: none !important;
}

/* Prevent text-shadow or clipping from cutting transparent gradient text */
.bg-clip-text, [class*="bg-clip-text"],
.text-transparent {
    text-shadow: none !important;
    filter: none !important;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Ensure gradient text elements have headroom for Vietnamese uppercase accents (Ấ, Ế, Ồ, Ớ, Ũ, Ĩ) */
h1 .bg-clip-text, h2 .bg-clip-text, h3 .bg-clip-text,
.hero-title .bg-clip-text, [class*="bg-clip-text"] {
    padding-top: 0.12em;
    padding-bottom: 0.08em;
}

/* ============================================================== */
/* PAGE LOAD & SCROLL TRANSITION EFFECTS                          */
/* ============================================================== */

/* Top slim progress bar */
#pageProgressBar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #e11d48, #f43f5e, #fb7185, #f59e0b);
    z-index: 99999;
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.7), 0 0 5px rgba(245, 158, 11, 0.5);
    transition: width 0.25s ease-out, opacity 0.4s ease;
    pointer-events: none;
}
#pageProgressBar.done {
    opacity: 0;
}

/* Gentle Page Entrance */
body {
    animation: pageFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes pageFadeIn {
    from {
        opacity: 0.85;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Reveal Elements */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Stagger delay helpers for grids */
.delay-75  { transition-delay: 75ms; }
.delay-150 { transition-delay: 150ms; }
.delay-225 { transition-delay: 225ms; }
.delay-300 { transition-delay: 300ms; }
.delay-375 { transition-delay: 375ms; }
.delay-450 { transition-delay: 450ms; }

/* Smooth filter transition for cards */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.animate-fadeIn {
    animation: cardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* News Article Card Polish */
.news-card-hover {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.news-card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -5px rgba(225, 29, 72, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}
.news-card-hover:hover .news-thumb-img {
    transform: scale(1.06);
}
.news-thumb-img {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modern Soft Curves */
.rounded-curved {
    border-radius: 28px;
}
.rounded-curved-lg {
    border-radius: 36px;
}
.rounded-curved-sm {
    border-radius: 18px;
}

/* Soft Modern Cards */
.card-soft {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-soft:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -5px rgba(225, 29, 72, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    border-color: rgba(225, 29, 72, 0.2);
}

/* Glassmorphism */
.glass-panel {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.glass-dark {
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Brand Buttons */
.btn-brand {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: #ffffff;
    font-weight: 600;
    border-radius: 9999px;
    padding: 0.75rem 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 20px -4px rgba(225, 29, 72, 0.4);
    transition: all 0.25s ease;
}
.btn-brand:hover {
    background: linear-gradient(135deg, #be123c 0%, #9f1239 100%);
    box-shadow: 0 12px 25px -4px rgba(225, 29, 72, 0.5);
    transform: translateY(-2px);
    color: #ffffff;
}

.btn-secondary-curve {
    background: #ffffff;
    color: var(--brand-dark);
    font-weight: 600;
    border-radius: 9999px;
    padding: 0.75rem 1.75rem;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
}
.btn-secondary-curve:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--brand-red);
    transform: translateY(-2px);
}

/* Wave dividers */
.wave-divider {
    overflow: hidden;
    position: relative;
    line-height: 0;
}
.wave-divider svg {
    display: block;
    width: 100%;
    height: 60px;
}
@media (min-width: 768px) {
    .wave-divider svg {
        height: 90px;
    }
}

/* Pulsing Phone Ring */
.pulse-call-btn {
    position: relative;
    animation: bounceSlow 3s infinite;
}
.pulse-call-btn::before,
.pulse-call-btn::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 9999px;
    background: rgba(225, 29, 72, 0.35);
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    z-index: -1;
}
.pulse-call-btn::after {
    animation-delay: 1s;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.95);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}
@keyframes bounceSlow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Interactive Map Hotspot Styling */
.map-hotspot {
    cursor: pointer;
    transition: all 0.3s ease;
}
.map-hotspot:hover .hotspot-circle {
    fill: #e11d48;
    transform: scale(1.3);
}
.map-hotspot:hover .hotspot-label {
    fill: #be123c;
    font-weight: 800;
}

/* Badges */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Custom Scrollbar (Desktop only) */
@media (min-width: 1024px) {
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    ::-webkit-scrollbar-track {
        background: #f1f5f9;
    }
    ::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 9999px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
}

@media (max-width: 1023px) {
    ::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
}

/* Image zoom effect on hover */
.img-zoom-container {
    overflow: hidden;
    border-radius: 20px;
}
.img-zoom-container img {
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.card-soft:hover .img-zoom-container img {
    transform: scale(1.07);
}

/* Modal lightbox */
.modal-backdrop {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
}



/* ============================================================== */
/* MODERN NAVIGATION & EFFECT ADDITIONS                           */
/* ============================================================== */

.nav-link-modern {
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0.45rem 0.75rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    color: #334155;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}
@media (min-width: 1280px) {
    .nav-link-modern {
        padding: 0.5rem 0.85rem;
        font-size: 0.825rem;
    }
}
.nav-link-modern:hover {
    color: #e11d48;
    background: rgba(225, 29, 72, 0.07);
    transform: translateY(-1.5px);
}
.nav-link-modern.active {
    color: #e11d48;
    background: rgba(225, 29, 72, 0.09);
    font-weight: 700;
}
.nav-link-modern.active::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2.5px;
    border-radius: 9999px;
    background: #e11d48;
    box-shadow: 0 1px 4px rgba(225, 29, 72, 0.4);
}

/* Floating Capsule Nav Container */
.nav-capsule {
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 9999px;
    padding: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Dropdown Menu Animation */
.dropdown-parent {
    position: relative;
}
.dropdown-menu-modern {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    min-width: 240px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    padding: 8px;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.02);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.97);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
}
.dropdown-parent:hover .dropdown-menu-modern {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.dropdown-item-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    transition: all 0.18s ease;
    white-space: nowrap;
    text-decoration: none;
}
.dropdown-item-modern:hover {
    background: #fff1f2;
    color: #e11d48;
    transform: translateX(3px);
}

/* Header dynamic size transition */
#mainHeader {
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, box-shadow 0.3s ease;
}
#mainHeader.header-scrolled {
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    background-color: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ============================================================== */
/* INTERACTIVE COVERAGE MAP PINS & ACCENTS                        */
/* ============================================================== */
.map-hotspot-item {
    z-index: 25 !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0.2s ease;
}
.map-hotspot-item:hover,
.map-hotspot-item:focus {
    z-index: 50 !important;
}
.map-hotspot-item .group-hover\/pin\:opacity-100 {
    z-index: 60 !important;
}
@keyframes trafficArteryPulse {
    0% {
        stroke-dashoffset: 24;
    }
    100% {
        stroke-dashoffset: 0;
    }
}
.animate-dash, svg path[stroke-dasharray] {
    animation: trafficArteryPulse 6s linear infinite;
}
#mainHeader.header-scrolled .header-inner {
    height: 66px;
}

/* ============================================================== */
/* ADMIN CP TYPOGRAPHY SCALING & READABILITY                     */
/* ============================================================== */
/* Ensure all form controls, buttons, tables inherit font family */
input, button, select, textarea, optgroup {
    font-family: var(--font-body) !important;
}

/* Admin Sidebar & Main Content Typography */
#adminSidebar,
#adminContent,
.admin-card,
table, th, td {
    font-family: var(--font-body) !important;
}

#adminSidebar h1, #adminSidebar h2, #adminSidebar h3,
#adminContent h1, #adminContent h2, #adminContent h3,
.admin-title {
    font-family: var(--font-heading) !important;
    letter-spacing: -0.015em;
}

/* Scaled Up Admin CP Base & Text Sizes */
#adminContent {
    font-size: 15px;
}

/* Page Titles */
#adminContent h1 {
    font-size: 2rem !important; /* 32px */
    font-weight: 800 !important;
    line-height: 1.3;
}
#adminContent h2 {
    font-size: 1.5rem !important; /* 24px */
    font-weight: 700 !important;
}
#adminContent h3 {
    font-size: 1.25rem !important; /* 20px */
    font-weight: 700 !important;
}

/* Top Stat Cards Numbers & Badges */
#adminContent .text-2xl,
#adminContent .text-3xl {
    font-size: 2.25rem !important; /* 36px */
    font-weight: 800 !important;
    letter-spacing: -0.02em;
}

/* Tables (Billboards, Leads, News, Services, Projects, Admins) */
#adminContent table {
    font-size: 14px !important;
}
#adminContent table thead th {
    font-size: 12.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}
#adminContent table tbody td {
    font-size: 14px !important;
    padding-top: 0.95rem !important;
    padding-bottom: 0.95rem !important;
    line-height: 1.5;
}

/* Form Inputs, Selects, Textareas, Labels */
#adminContent label {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
}
#adminContent input[type="text"],
#adminContent input[type="email"],
#adminContent input[type="password"],
#adminContent input[type="tel"],
#adminContent input[type="number"],
#adminContent input[type="date"],
#adminContent select,
#adminContent textarea {
    font-size: 15px !important;
    padding: 0.85rem 1.15rem !important;
    line-height: 1.5;
}

/* Admin Action Buttons & Links */
#adminContent .btn-brand,
#adminContent button[type="submit"],
#adminContent a[class*="btn-brand"],
#adminContent a[href*="-edit.php"] {
    font-size: 14.5px !important;
    font-weight: 700 !important;
}

/* Quick Filter Pills in Billboards */
#adminContent a[href*="billboards.php"] span,
#adminContent a[href*="billboards.php"] {
    font-size: 13px !important;
}

/* ============================================================== */
/* INFINITE LOGO MARQUEE (PARTNERS & CLIENTS)                     */
/* ============================================================== */
@keyframes partnerMarquee {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.partner-marquee-wrapper {
    overflow: hidden !important;
    overflow: clip !important;
    overflow-clip-margin: 0px !important;
    contain: strict !important;
}

.partner-marquee-track {
    display: flex;
    width: max-content;
    align-items: center;
    gap: 1.5rem;
    will-change: transform;
    animation: partnerMarquee 38s linear infinite;
}

.partner-marquee-wrapper:hover .partner-marquee-track {
    animation-play-state: paused;
}

@media (max-width: 640px) {
    .partner-marquee-track {
        animation-duration: 28s;
        gap: 1rem;
    }
}

/* ============================================================== */
/* MOBILE NAVIGATION DRAWER (FLUID, BULLETPROOF, ZERO OVERFLOW)  */
/* ============================================================== */
#drawerOverlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

#drawerOverlay.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

#mobileDrawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background-color: #ffffff;
    z-index: 9999;
    box-shadow: -12px 0 36px rgba(0, 0, 0, 0.22);
    transform: translate3d(100%, 0, 0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-top-left-radius: 28px;
    border-bottom-left-radius: 28px;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#mobileDrawer.is-open {
    display: flex !important;
    transform: translate3d(0, 0, 0) !important;
}

@media (min-width: 1024px) {
    #drawerOverlay,
    #mobileDrawer {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* Hero Background Video Containment (Prevents any video decoding jitter or reflow) */
#heroVideo {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    pointer-events: none !important;
    contain: strict !important;
    transform: translateZ(0) !important;
    will-change: opacity !important;
}
