/* ========== CUSTOM STYLES (non-Tailwind) ========== */

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Font smoothing */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== MEGA MENU ========== */
.mega-menu {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100vw;
    background: #0a0a0a;
    padding: 50px 60px 60px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 999;
}
.mega-menu.visible {
    display: flex;
    justify-content: center;
    opacity: 1;
    transform: translateY(0);
}

/* ========== HAMBURGER ========== */
.hamburger span {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ========== MOBILE MENU ========== */
.mobile-menu {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.mobile-menu.open {
    display: flex;
    opacity: 1;
}
.mobile-menu a {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}
.mobile-menu.open a {
    opacity: 1;
    transform: translateY(0);
}
.mobile-menu.open a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.open a:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.open a:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.open a:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.open a:nth-child(5) { transition-delay: 0.3s; }
.mobile-menu.open a:nth-child(6) { transition-delay: 0.35s; }

/* ========== SCROLL REVEAL ========== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.rd1 { transition-delay: 0.1s; }
.rd2 { transition-delay: 0.2s; }
.rd3 { transition-delay: 0.3s; }
.rd4 { transition-delay: 0.4s; }

/* ========== HEADER SCROLL STATE ========== */
.header-transparent { background: transparent; }
.header-scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
    border-radius: 100px;
}
.header-scrolled .nav-link,
.header-scrolled .logo-text,
.header-scrolled .header-right-link {
    color: #262626 !important;
}
.header-scrolled .logo-svg { fill: #262626 !important; }
.header-scrolled .header-sep { background: rgba(0, 0, 0, 0.2) !important; }
.header-scrolled .btn-marketplace {
    background: #262626 !important;
    color: #fff !important;
}

/* Dark header variant (stays dark on scroll) */
.header-dark { background: #0a0a0a; }
.header-dark.header-scrolled {
    background: #0a0a0a;
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}
.header-dark.header-scrolled .nav-link,
.header-dark.header-scrolled .logo-text,
.header-dark.header-scrolled .header-right-link {
    color: #fff !important;
}
.header-dark.header-scrolled .logo-svg { fill: #fff !important; }
.header-dark.header-scrolled .btn-marketplace {
    background: #fff !important;
    color: #0a0a0a !important;
}

/* ========== NAV LINK UNDERLINE ========== */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .mega-menu {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

/* ========== GLOBAL MOBILE RESPONSIVE ========== */

/* --- Tablet (max-width: 1024px) --- */
@media (max-width: 1024px) {
    /* Brand pages: reduce side padding */
    section[class*="px-[60px]"],
    footer[class*="px-[60px]"] {
        padding-left: 32px !important;
        padding-right: 32px !important;
    }

    /* 4-col grids → 2 cols */
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* 3-col grids → 2 cols */
    .grid-cols-3:not(.grid-cols-4 *) {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Install section: reduce height on tablet */
    .install-image-wrap {
        height: 400px !important;
    }
}

/* --- Mobile (max-width: 768px) --- */
@media (max-width: 768px) {

    /* ===== GLOBAL PADDING FIX ===== */
    section[class*="px-[60px]"],
    footer[class*="px-[60px]"] {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* ===== GRID STACKING ===== */
    /* All multi-col grids → 1 col on mobile */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }

    /* Fix grid spans (col-span-2, col-span-3, etc.) */
    [class*="col-span-"] {
        grid-column: span 1 !important;
    }

    /* Fix grid row spans */
    [class*="row-span-"] {
        grid-row: span 1 !important;
    }

    /* ===== SECTION SPACING ===== */
    /* Reduce vertical padding on sections */
    section[class*="py-24"] {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }
    section[class*="py-[100px]"] {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }
    section[class*="py-[160px]"] {
        padding-top: 80px !important;
        padding-bottom: 80px !important;
    }
    section[class*="py-[80px]"] {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }

    /* ===== HOMEPAGE HERO ===== */
    .dreelio-bg {
        padding-top: 100px !important;
        padding-bottom: 20px !important;
    }
    .hero-title {
        font-size: clamp(28px, 8vw, 40px) !important;
        margin-bottom: 12px !important;
    }
    .hero-subtitle {
        font-size: 13px !important;
        margin-bottom: 20px !important;
        max-width: 90% !important;
    }
    .hero-ctas {
        margin-bottom: 32px !important;
    }
    .hero-dashboard-wrap {
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin-top: 0 !important;
    }
    .hero-dashboard {
        transform: perspective(1400px) rotateX(6deg) scale(0.92) !important;
    }

    /* ===== HOMEPAGE SHOWCASE TOGGLE ===== */
    #showcaseWrapper {
        height: 400px !important;
        border-radius: 16px !important;
    }
    #showcaseWrapper .absolute.bottom-24 {
        bottom: auto !important;
        top: 20px !important;
        left: 16px !important;
        right: 16px !important;
    }
    #showcaseWrapper [class*="text-[32px]"] {
        font-size: 20px !important;
    }
    /* Toggle pills at bottom */
    #showcaseWrapper .absolute.bottom-6 {
        bottom: 10px !important;
    }
    #showcaseWrapper .absolute.bottom-6 button {
        padding: 6px 12px !important;
        font-size: 10px !important;
    }

    /* ===== HOMEPAGE HOW IT WORKS ===== */
    /* Dashboard mockup inner padding */
    .rounded-\[24px\] > .bg-white {
        overflow-x: auto;
    }
    .rounded-\[24px\][style*="padding: 40px"] {
        padding: 16px 16px 0 !important;
    }
    /* Stats grid inside mockups */
    .grid.grid-cols-4.gap-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    /* Image grid inside mockups */
    .grid.grid-cols-3.gap-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .grid.grid-cols-3.gap-3 > :last-child {
        display: none;
    }

    /* ===== BENTO CARDS ===== */
    .bento-card {
        padding: 20px !important;
    }
    .bento-card h3 {
        font-size: 16px !important;
    }

    /* ===== BLOG SECTION ===== */
    .blog-card {
        width: 100% !important;
    }
    /* Blog featured article */
    section[style*="background: #e8edf4"] .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* ===== CTA SECTION ===== */
    section[style*="background: linear-gradient(180deg, #f8f5f1"] {
        padding: 60px 20px !important;
    }

    /* ===== FOOTER ===== */
    footer .flex-col.lg\\:flex-row {
        flex-direction: column !important;
    }
    footer .flex-col.sm\\:flex-row {
        flex-direction: column !important;
        gap: 24px !important;
    }

    /* ===== BRAND PAGES — HERO ===== */
    section[class*="pt-16"][class*="pb-24"][class*="px-[60px]"] {
        padding-top: 80px !important;
        padding-bottom: 40px !important;
    }
    section[class*="pt-16"][class*="pb-24"] h1 {
        font-size: clamp(28px, 7vw, 42px) !important;
    }

    /* ===== BRAND PAGES — INSTALL TABS ===== */
    .install-tab {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }
    .install-tab svg {
        width: 12px !important;
        height: 12px !important;
    }
    /* Install section image */
    #installImg {
        height: 250px !important;
        object-fit: cover;
    }
    /* Install image wrapper container */
    .install-image-wrap {
        height: 300px !important;
    }

    /* ===== BRAND PAGES — FAQ ===== */
    /* FAQ layout: stack left title + right Q&A */
    .grid.grid-cols-4.gap-12 {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    .col-span-1,
    .col-span-2 {
        grid-column: span 1 !important;
    }

    /* ===== BRAND PAGES — STATS SECTION ===== */
    .grid.grid-cols-3.grid-rows-2 {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }

    /* ===== TESTIMONIALS ===== */
    .testi-card {
        min-width: 260px !important;
        padding: 20px !important;
    }

    /* ===== PRICING CARDS ===== */
    .pricing-card {
        padding: 20px !important;
    }

    /* ===== NAV PILL ===== */
    .nav-pill {
        padding: 10px 16px !important;
        min-height: 52px !important;
    }
    .nav-pill .hamburger {
        width: 36px !important;
        height: 36px !important;
        padding: 6px !important;
    }
    .nav-pill .hamburger span {
        width: 22px !important;
    }
    /* Hide desktop nav links on mobile */
    .nav-dropdown-wrap,
    .nav-pill > a[class*="text-[13px]"],
    .nav-pill .hidden.lg\\:flex {
        display: none !important;
    }

    /* Mobile menu links — bigger touch targets */
    .mobile-menu a {
        font-size: 20px !important;
        padding: 8px 0 !important;
    }
    .mobile-menu .lang-btn-mobile {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
    /* Mobile menu marketplace button */
    .mobile-menu a[href*="marketplace"] {
        padding: 14px 32px !important;
        font-size: 14px !important;
    }

    /* ===== TYPOGRAPHY SCALING ===== */
    h2[class*="text-[clamp(36px"] {
        font-size: clamp(26px, 6vw, 36px) !important;
    }
    h2[class*="text-[clamp(32px"] {
        font-size: clamp(24px, 5.5vw, 32px) !important;
    }
    h2[class*="text-[clamp(28px"] {
        font-size: clamp(22px, 5vw, 28px) !important;
    }
    h3[class*="text-[clamp(32px"] {
        font-size: clamp(22px, 5vw, 30px) !important;
    }
    h3[class*="text-[clamp(22px"] {
        font-size: clamp(18px, 4vw, 22px) !important;
    }

    /* ===== VENUE PAGES ===== */
    /* Large text in venue hero */
    .text-\[clamp\(48px\,6vw\,72px\)\] {
        font-size: clamp(28px, 7vw, 42px) !important;
    }

    /* ===== CLOUDS — HIDE ON MOBILE ===== */
    .cloud-3, .cloud-4, .cloud-5, .cloud-6 {
        display: none !important;
    }
    .cloud-1, .cloud-2 {
        opacity: 0.5;
    }

    /* ===== FIX OVERFLOW ===== */
    body {
        overflow-x: hidden !important;
    }
    section, footer, header {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* ===== MARQUEE / LOGO TICKER ===== */
    .marquee-track span {
        font-size: 16px !important;
        margin-left: 20px !important;
        margin-right: 20px !important;
    }
}

/* --- Small phones (max-width: 480px) --- */
@media (max-width: 480px) {
    section[class*="px-[60px]"],
    footer[class*="px-[60px]"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .hero-title {
        font-size: 26px !important;
        letter-spacing: -1.5px !important;
    }
    .hero-subtitle {
        font-size: 12px !important;
    }

    #showcaseWrapper {
        height: 320px !important;
    }

    /* Install section image on small phones */
    .install-image-wrap {
        height: 280px !important;
    }

    /* Install tabs wrap on small screens */
    .flex.items-center.gap-2:has(.install-tab),
    .flex.items-center.gap-3:has(.install-tab) {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    .install-tab {
        padding: 6px 10px !important;
        font-size: 10px !important;
    }

    /* CTA buttons */
    .btn-primary, .btn-secondary {
        padding: 12px 20px !important;
        font-size: 12px !important;
    }

    /* Footer columns */
    footer .flex-col.sm\\:flex-row {
        gap: 20px !important;
    }
}
