/* Custom CSS for Einova Business Setup Portal */

/* ========================================
   DESKTOP DROPDOWN MENU - JS CONTROLLED
   Overrides Tailwind group-hover to prevent
   instant opening. Uses JS dropdown-active class.
   ======================================== */
@media (min-width: 1024px) {
    /* Override Tailwind group-hover: prevent dropdowns from showing on CSS hover */
    #header nav .relative.group > .absolute {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(8px);
        transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    }

    /* Show dropdown when JS adds dropdown-active class */
    #header nav .relative.group.dropdown-active > .absolute {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateY(0);
    }

    /* Bridge the vertical gap (mt-2) between nav button and dropdown panel */
    #header nav .relative.group > .absolute::before {
        content: '';
        position: absolute;
        top: -12px;
        left: 0;
        right: 0;
        height: 12px;
        background: transparent;
    }

    /* Override nested Tailwind group-hover variants for sub-dropdowns */
    #header nav [class*="group/"] > .absolute {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    /* Show nested dropdown when JS adds dropdown-active */
    #header nav [class*="group/"].dropdown-active > .absolute {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    /* Bridge the horizontal gap (ml-3) for nested side-opening dropdowns */
    #header nav [class*="group/"] > .absolute::before {
        content: '';
        position: absolute;
        left: -16px;
        top: 0;
        width: 16px;
        height: 100%;
        background: transparent;
    }
}

/* ========================================
   PROFESSIONAL FONT SIZE SYSTEM
   ======================================== */

/* Base Font Settings - Professional Scale */
:root {
    /* Primary Headings */
    --font-h1: 2.5rem;          /* 40px - Main hero headings */
    --font-h2: 2rem;            /* 32px - Section headings */
    --font-h3: 1.5rem;          /* 24px - Card titles, sub-headings */
    --font-h4: 1.25rem;         /* 20px - Small headings */
    
    /* Body Text */
    --font-base: 1rem;          /* 16px - Standard body text */
    --font-lg: 1.125rem;        /* 18px - Large body text */
    --font-sm: 0.875rem;        /* 14px - Small text */
    --font-xs: 0.75rem;         /* 12px - Extra small text */
    
    /* Button & CTA Text */
    --font-btn: 1rem;           /* 16px - Standard buttons */
    --font-btn-lg: 1.125rem;    /* 18px - Large CTA buttons */
    
    /* Line Heights */
    --line-tight: 1.25;
    --line-normal: 1.5;
    --line-relaxed: 1.75;
    --header-mobile-height: 64px;
}

/* --- MOBILE-ONLY OVERFLOW & LAYOUT FIXES (Jan 20, 2026) --- */
@media (max-width: 1023px) {
    /* Prevent all sections and containers from overflowing viewport */
    section, .container, main, header, footer, nav, [class*="grid"], [class*="flex"] {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    /* Aggressive overflow fix for mobile: clip all horizontal overflow */
    html, body, main, #home, #company-formation-experts, #testimonials, #free-zones-authorities, #faq, #contact, #about {
        overflow-x: hidden !important;
        position: relative !important;
    }
    /* Remove extra paddings/margins that cause horizontal scroll */
    .container, section {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    /* Ensure grid and flex layouts wrap and do not overflow */
    [class*="grid"], [class*="flex"] {
        flex-wrap: wrap !important;
        min-width: 0 !important;
        max-width: 100vw !important;
    }
    /* Ensure all absolutely positioned blobs/decorative elements are clipped */
    .absolute, [class*="absolute"], .-top-6, .-right-6, .-bottom-6, .-left-6 {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        left: 0 !important;
        right: 0 !important;
    }
    /* Make all images responsive */
    img, video, iframe {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    /* Remove fixed widths on buttons/links */
    a, button {
        max-width: 100vw !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
    }
    /* Remove negative margins on hero blobs/decorative elements */
    .-top-6, .-right-6, .-bottom-6, .-left-6 {
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        margin: 0 !important;
    }
    /* Fix grid gaps for mobile */
    [class*="gap-"] {
        gap: 1rem !important;
    }
    /* Prevent card and group elements from overflowing */
    .group, .card {
        max-width: 100vw !important;
        overflow-x: auto !important;
    }
    /* Remove extra border width on mobile */
    .border-2, .border-4, .border-8 {
        border-width: 1px !important;
    }
    /* Ensure hero section fits viewport */
    #home {
        min-width: 0 !important;
        width: 100vw !important;
        overflow-x: hidden !important;
    }
    /* Remove excessive min-widths */
    [style*="min-width"] {
        min-width: 0 !important;
    }
}

/* Responsive Font Adjustments */
@media (min-width: 768px) {
    :root {
        --font-h1: 3rem;        /* 48px on tablet+ */
        --font-h2: 2.25rem;     /* 36px on tablet+ */
    }
}

@media (min-width: 1024px) {
    :root {
        --font-h1: 3.5rem;      /* 56px on desktop+ */
        --font-h2: 2.5rem;      /* 40px on desktop+ */
    }
}

/* ========================================
   IMAGE VISIBILITY & CARD FIXES
   ======================================== */

/* Ensure all images are visible and load properly */
img {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix for card images with object-cover */
.group img.object-cover,
img.object-cover {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Ensure card images within service cards load properly */
.group .relative img,
.relative.h-48 img,
.relative.h-56 img,
.relative.h-64 img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Lazy loaded images should be visible */
img[loading="lazy"] {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ========================================
   LOGO ENHANCEMENT - SITEWIDE SHARED STYLE
   ======================================== */

.logo-link {
    position: relative;
}

.logo-container {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.logo-image {
    filter: none;
    transition: none;
}

.logo-link:hover .logo-container,
.logo-container:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
}

.logo-link:hover .logo-image,
.logo-container:hover .logo-image {
    filter: none;
    transform: none;
}

.logo-container-footer {
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.38), 0 0 0 1px rgba(148, 163, 184, 0.16) inset;
}

.logo-wordmark-image {
    width: auto !important;
    height: 42px !important;
    max-width: 240px !important;
}

@media (min-width: 1024px) {
    .logo-wordmark-image {
        height: 50px !important;
        max-width: 300px !important;
    }
}

/* ========================================
   COMPANY NAME - DARK GOLDEN COLOR
   ======================================== */

/* Dark Golden Company Name Styling */
.company-name-golden {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 50%, #ffd700 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
    filter: brightness(1.1) contrast(1.1);
}

#header a:hover .company-name-golden {
    background: linear-gradient(135deg, #daa520 0%, #ffd700 50%, #ffed4e 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    filter: brightness(1.15) contrast(1.15);
}

/* Legacy company name styling - kept for backwards compatibility */
#header .bg-gradient-to-r.from-blue-600 {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 50%, #ffd700 100%) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* ========================================
   HEADER WHITE THEME OVERRIDES
   Improves logo visibility and overall contrast
   ======================================== */

#header {
    background: transparent !important;
}

#header > div:first-child,
#header nav,
#mobile-menu {
    background: linear-gradient(180deg, rgba(232, 240, 249, 0.97) 0%, rgba(224, 234, 245, 0.97) 100%) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-color: rgba(148, 163, 184, 0.45) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

/* ========================================
   MOBILE HEADER + MENU STABILITY
   ======================================== */

@media (max-width: 1023px) {
    #header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 9999;
    }

    #header > div:first-child {
        min-height: var(--header-mobile-height);
    }

    body {
        padding-top: var(--header-mobile-height);
    }

    #mobile-menu {
        display: block;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 280ms ease, opacity 200ms ease;
        border-top: 1px solid rgba(148, 163, 184, 0.35) !important;
    }

    #mobile-menu.mobile-menu-open {
        max-height: calc(100vh - var(--header-mobile-height));
        opacity: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .logo-link .logo-image {
        max-height: 44px;
        width: auto;
    }
}

@media (max-width: 639px) {
    :root {
        --header-mobile-height: 60px;
    }

    .logo-link .logo-image {
        max-height: 40px;
    }
}

#header .text-gray-100,
#header .text-gray-300,
#header .text-gray-400,
#header .text-gray-500 {
    color: #334155 !important;
}

#header .nav-link,
#header nav button.nav-link,
#header #mobile-menu a,
#header #mobile-menu button,
#mobile-menu-btn {
    color: #1e293b !important;
}

#header .nav-link:hover,
#header nav button.nav-link:hover,
#header #mobile-menu a:hover,
#header #mobile-menu button:hover,
#mobile-menu-btn:hover {
    color: #2563eb !important;
}

#mobile-menu-btn svg {
    stroke: #1e293b !important;
}

#mobile-menu-btn:hover svg {
    stroke: #2563eb !important;
}

#header .bg-gray-800\/40,
#header .bg-gray-700\/60,
#header .bg-gray-800\/60,
#header .bg-gray-900\/50 {
    background-color: rgba(241, 245, 249, 0.9) !important;
}

#header .bg-gray-900\/95,
#header .bg-gray-900\/98 {
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.96) 0%, rgba(236, 244, 252, 0.98) 100%) !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}

#header .border-gray-700\/30,
#header .border-gray-700\/50 {
    border-color: rgba(148, 163, 184, 0.3) !important;
}

#header .shadow-black\/50 {
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14) !important;
}

#header .logo-container {
    background: transparent;
    border: none;
    box-shadow: none;
}

#header .logo-link:hover .logo-container,
#header .logo-container:hover {
    border-color: transparent;
    box-shadow: none;
}

/* ========================================
   SITEWIDE LIGHT CONTENT THEME
   Aligns shared page surfaces with the white header
   ======================================== */

:root {
    --site-bg: #eef4fb;
    --site-bg-soft: #f8fbff;
    --site-surface: rgba(255, 255, 255, 0.88);
    --site-surface-strong: rgba(255, 255, 255, 0.96);
    --site-border: rgba(148, 163, 184, 0.2);
    --site-text: #0f172a;
    --site-text-muted: #475569;
    --site-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

body {
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 34%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 48%, #e6eef8 100%);
    color: var(--site-text);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.12) 0%, transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(14, 165, 233, 0.08) 0%, transparent 26%),
        radial-gradient(circle at 50% 78%, rgba(148, 163, 184, 0.12) 0%, transparent 30%);
    pointer-events: none;
    z-index: -1;
}

main section,
body > section,
main section[class*="from-gray-950"],
body > section[class*="from-gray-950"],
main section[class*="from-gray-900"],
body > section[class*="from-gray-900"],
main section[class*="from-black"],
body > section[class*="from-black"],
main section[style*="#0f172a"],
body > section[style*="#0f172a"],
main section[style*="#1e293b"],
body > section[style*="#1e293b"] {
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.94) 0%, rgba(238, 244, 251, 0.98) 100%) !important;
}

body > section > .absolute {
    opacity: 0.35;
}

main [class*="from-gray-800/90 to-gray-900/90"],
body > section [class*="from-gray-800/90 to-gray-900/90"],
main [class*="from-gray-800/60 to-gray-900/60"],
body > section [class*="from-gray-800/60 to-gray-900/60"],
main [class*="from-gray-800/50 to-gray-900/50"],
body > section [class*="from-gray-800/50 to-gray-900/50"],
main [class*="bg-gray-900/60"],
body > section [class*="bg-gray-900/60"],
main [class*="bg-gray-900/50"],
body > section [class*="bg-gray-900/50"],
main [class*="bg-gray-800/50"],
body > section [class*="bg-gray-800/50"],
main [class*="bg-gray-800/40"],
body > section [class*="bg-gray-800/40"] {
    background: linear-gradient(180deg, var(--site-surface-strong) 0%, var(--site-surface) 100%) !important;
    border-color: var(--site-border) !important;
    box-shadow: var(--site-shadow);
}

main .faq-answer,
body > section .faq-answer,
main input[class*="bg-gray-900/60"],
body > section input[class*="bg-gray-900/60"],
main select[class*="bg-gray-900/60"],
body > section select[class*="bg-gray-900/60"],
main textarea[class*="bg-gray-900/60"],
body > section textarea[class*="bg-gray-900/60"] {
    background: rgba(255, 255, 255, 0.94) !important;
    color: var(--site-text) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
}

main h1,
body > section h1,
main h2,
body > section h2,
main h3,
body > section h3,
main h4,
body > section h4,
main h5,
body > section h5,
main h6,
body > section h6,
main .text-white,
body > section .text-white,
main .text-gray-100,
body > section .text-gray-100,
main .text-gray-300,
body > section .text-gray-300,
main .text-gray-400,
body > section .text-gray-400 {
    color: var(--site-text) !important;
}

main p,
body > section p,
main li,
body > section li,
main label,
body > section label,
main .text-gray-500,
body > section .text-gray-500 {
    color: var(--site-text-muted) !important;
}

main .border-gray-700,
body > section .border-gray-700,
main [class*="border-gray-700/30"],
body > section [class*="border-gray-700/30"],
main [class*="border-gray-700/50"],
body > section [class*="border-gray-700/50"] {
    border-color: var(--site-border) !important;
}

main a[class*="bg-gradient-to-r from-blue-"],
main a[class*="bg-gradient-to-r from-green-"],
main a[class*="bg-gradient-to-r from-purple-"],
main a[class*="bg-gradient-to-r from-orange-"],
main a[class*="bg-white text-blue-"],
main a[class*="bg-gray-900 text-white"],
main button[class*="bg-gradient-to-r from-blue-"],
main button[class*="bg-gradient-to-r from-green-"],
main button[class*="bg-gradient-to-r from-purple-"],
main span[class*="bg-blue-"],
main span[class*="bg-green-"],
main span[class*="bg-purple-"],
main span[class*="bg-orange-"],
main div[class*="from-blue-500 to-blue-600"],
main div[class*="from-purple-500 to-purple-600"],
main div[class*="from-green-500 to-green-600"],
main div[class*="from-orange-500 to-orange-600"],
main div[class*="from-blue-600 to-blue-700"],
main div[class*="from-purple-600 to-purple-700"],
main div[class*="from-green-600 to-green-700"] {
    color: #ffffff !important;
}

main a[class*="bg-gradient-to-r from-blue-"] .text-white,
main a[class*="bg-gradient-to-r from-green-"] .text-white,
main a[class*="bg-gradient-to-r from-purple-"] .text-white,
main a[class*="bg-gradient-to-r from-orange-"] .text-white,
main button[class*="bg-gradient-to-r from-blue-"] .text-white,
main button[class*="bg-gradient-to-r from-green-"] .text-white,
main button[class*="bg-gradient-to-r from-purple-"] .text-white,
main span[class*="bg-blue-"] .text-white,
main span[class*="bg-green-"] .text-white,
main span[class*="bg-purple-"] .text-white,
main div[class*="from-blue-500 to-blue-600"] .text-white,
main div[class*="from-purple-500 to-purple-600"] .text-white,
main div[class*="from-green-500 to-green-600"] .text-white,
main div[class*="from-orange-500 to-orange-600"] .text-white,
main div[class*="from-blue-600 to-blue-700"] .text-white,
main div[class*="from-purple-600 to-purple-700"] .text-white,
main div[class*="from-green-600 to-green-700"] .text-white {
    color: #ffffff !important;
}

/* ========================================
   HEADER DROPDOWN PANELS - WHITE THEME
   ======================================== */
.nav-dropdown {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Text color overrides for white background readability */
.nav-dropdown .text-gray-100 { color: #111827 !important; }
.nav-dropdown .text-gray-300 { color: #374151 !important; }
.nav-dropdown .text-gray-400 { color: #6b7280 !important; }
.nav-dropdown .text-gray-500 { color: #6b7280 !important; }

/* Light border colors inside panels */
.nav-dropdown [class*="border-gray-7"] { border-color: #e5e7eb !important; }

/* Column card and card footer gradient backgrounds -> light gray */
.nav-dropdown .bg-gradient-to-b {
    background-image: none !important;
    background-color: #f9fafb !important;
}

/* Location card image-area link border */
.nav-dropdown [class*="border-gray-7"] { border-color: #e5e7eb !important; }

/* Keep footer appearance aligned with production */
footer[role="contentinfo"][itemtype="https://schema.org/WPFooter"] {
    background: linear-gradient(160deg, #123452 0%, #1b4a73 48%, #36506d 78%, #6f5a2f 100%) !important;
    border-top: 1px solid rgba(229, 194, 102, 0.34);
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.25);
}

footer[role="contentinfo"][itemtype="https://schema.org/WPFooter"] .border-t {
    border-color: rgba(229, 194, 102, 0.24) !important;
}
/* ...existing code... */