/* ============================================
   1. RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    letter-spacing: -0.01em;
    overflow-x: hidden;
    background: #ffffff;
    color: #1a1f36;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

.font-display { font-family: 'Plus Jakarta Sans', sans-serif; }
.font-heading  { font-family: 'Space Grotesk', sans-serif; }

/* ============================================
   2. GRADIENTS & UTILITIES
   ============================================ */
.gradient-hero {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f36 50%, #2d3561 100%);
}
.gradient-accent {
    background: linear-gradient(135deg, #1a73e8 0%, #00d4ff 100%);
}
.gradient-brand {
    background: linear-gradient(135deg, #1a73e8 0%, #185abc 100%);
}
.gradient-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
}
.gradient-text {
    background: linear-gradient(135deg, #1a73e8 0%, #00d4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gradient-gold-text {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 50%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.text-balance { text-wrap: balance; }
.text-pretty  { text-wrap: pretty; }

.grid-pattern {
    background-image:
        linear-gradient(rgba(26, 115, 232, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 115, 232, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

.shape-1 { background: radial-gradient(circle, rgba(26, 115, 232, 0.15), transparent 70%); }
.shape-2 { background: radial-gradient(circle, rgba(0, 212, 255, 0.15), transparent 70%); }

/* ============================================
   3. BUTTONS
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, #1a73e8 0%, #185abc 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #185abc 0%, #0d2f6b 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(26, 115, 232, 0.3);
}

.glow-btn {
    position: relative;
    overflow: hidden;
}
.glow-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.glow-btn:hover::before { left: 100%; }

/* ============================================
   4. HEADER & NAVIGATION
   ============================================ */
header {
    position: relative;
    z-index: 1000;
}

.nav-item {
    position: relative;
    z-index: 100;
}

.nav-link {
    position: relative;
    padding: 0.5rem 0;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 2px;
    background: #1a73e8;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
.nav-item:hover .nav-link::after { width: 100%; }

.chevron {
    transition: transform 0.3s ease;
    display: inline-block;
}
.nav-item:hover .chevron {
    transform: rotate(180deg);
}

/* ============================================
   MEGA DROPDOWN - FIXED POSITIONING
   ============================================ */
.mega-dropdown {
    position: fixed !important;
    top: 115px !important; /* Adjust based on your header height */
    left: 50vw !important; /* Center on viewport, not nav item */
    transform: translateX(-50%) translateY(8px);
    width: 90vw !important;
    max-width: 1200px !important;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.nav-item:hover .mega-dropdown,
.nav-item.group:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.mega-menu {
    width: 100%;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 100px -20px rgba(0,0,0,0.3);
    padding: 2rem;
    border: 1px solid rgba(26, 115, 232, 0.1);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

/* Desktop: Full width with padding */
@media (min-width: 1280px) {
    .mega-dropdown {
        width: 1100px !important;
        max-width: 1100px !important;
    }
}

/* Tablet: Slightly smaller */
@media (max-width: 1279px) and (min-width: 768px) {
    .mega-dropdown {
        width: 95vw !important;
        max-width: 900px !important;
    }
}

/* Mobile: Full width with margins */
@media (max-width: 767px) {
    .mega-dropdown {
        top: 115px !important;
        left: 50vw !important;
        width: 95vw !important;
        max-width: none !important;
        padding: 0 0.5rem;
    }
    
    .mega-menu {
        padding: 1.5rem;
        max-height: calc(100vh - 120px);
    }
    
    .mega-menu .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    /* Hide featured card on mobile */
    .mega-menu > div:last-child {
        display: none;
    }
}

/* Small mobile: Even more compact */
@media (max-width: 479px) {
    .mega-dropdown {
        top: 70px !important;
        width: 98vw !important;
    }
    
    .mega-menu {
        padding: 1rem;
    }
}
/* ============================================
   6. MOBILE MENU / DRAWER
   ============================================ */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.mobile-menu.open {
    transform: translateX(0);
}

/* Drawer overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Drawer header - search box area */
.drawer-header {
    position: sticky;
    top: 0;
    z-index: 10001;
    background: #fff;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* Drawer search input */
.drawer-search {
    position: relative;
    z-index: 10002;
}
.drawer-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.drawer-search input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Drawer body - scrollable content */
.drawer-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

/* Drawer custom scrollbar */
.drawer-body::-webkit-scrollbar {
    width: 6px;
}
.drawer-body::-webkit-scrollbar-track {
    background: transparent;
}
.drawer-body::-webkit-scrollbar-thumb {
    background: rgba(26, 115, 232, 0.3);
    border-radius: 3px;
}
.drawer-body::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 115, 232, 0.6);
}

/* Drawer nav links */
.drawer-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #1a1f36;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}
.drawer-nav-link:hover {
    background: #f3f4f6;
}

/* ============================================
   7. COLLAPSIBLE TABS (DYNAMIC ARROW)
   ============================================ */
.collapsible-tab {
    border-bottom: 1px solid #f3f4f6;
}

/* Arrow - hidden by default, only shows when tab has children */
.tab-arrow {
    display: none; /* hidden initially */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-left: 0.5rem;
    color: #6b7280;
}

/* Show arrow ONLY when tab has sub-items */
.has-children .tab-arrow {
    display: inline-block;
}

/* Rotate arrow when tab is open */
.collapsible-tab.open .tab-arrow {
    transform: rotate(180deg);
}

/* Sub-menu - hidden by default */
.tab-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 1rem;
}

/* Sub-menu visible when parent is open */
.collapsible-tab.open .tab-submenu {
    max-height: 500px; /* large enough for content */
}

.tab-submenu a {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
    color: #4b5563;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}
.tab-submenu a:hover {
    background: #e8f0fe;
    color: #1a73e8;
    padding-left: 1.25rem;
}

/* ============================================
   8. CODE EDITOR / TERMINAL FIX
   ============================================ */
.code-editor,
.terminal-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 0.75rem;
}

.code-editor pre,
.terminal-container pre {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    white-space: pre;
    word-wrap: normal;
    margin: 0;
    padding: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.code-editor code,
.terminal-container code {
    display: block;
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Terminal scrollbar */
.terminal-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.terminal-scrollbar::-webkit-scrollbar-track { background: transparent; }
.terminal-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
.terminal-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   9. CARDS & ANIMATIONS
   ============================================ */
.hover-lift {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(26, 115, 232, 0.25);
}

.service-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, #1a73e8, #00d4ff);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px -12px rgba(26, 115, 232, 0.3);
}
.service-card:hover .service-icon {
    transform: scale(1.15) rotate(-5deg);
}
.service-icon { transition: all 0.5s ease; }

.feature-card,
.domain-card,
.testimonial-card,
.support-card,
.stat-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out backwards;
}
.feature-card:hover,
.domain-card:hover,
.testimonial-card:hover,
.support-card:hover {
    transform: translateY(-8px);
}
.stat-card:hover { transform: scale(1.05); }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.domain-card:nth-child(1) { animation-delay: 0.1s; }
.domain-card:nth-child(2) { animation-delay: 0.15s; }
.domain-card:nth-child(3) { animation-delay: 0.2s; }
.domain-card:nth-child(4) { animation-delay: 0.25s; }
.domain-card:nth-child(5) { animation-delay: 0.3s; }
.domain-card:nth-child(6) { animation-delay: 0.35s; }

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.15s; }
.feature-card:nth-child(3) { animation-delay: 0.2s; }
.feature-card:nth-child(4) { animation-delay: 0.25s; }

.testimonial-card:nth-child(1) { animation-delay: 0.1s; }
.testimonial-card:nth-child(2) { animation-delay: 0.2s; }
.testimonial-card:nth-child(3) { animation-delay: 0.3s; }

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }

.support-card:nth-child(1) { animation-delay: 0.2s; }
.support-card:nth-child(2) { animation-delay: 0.3s; }
.support-card:nth-child(3) { animation-delay: 0.4s; }
.support-card:nth-child(4) { animation-delay: 0.5s; }

/* ============================================
   10. REVEAL ON SCROLL
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   11. HERO FLOATING ELEMENTS
   ============================================ */
.hero-float-1 { animation: float 6s ease-in-out infinite; }
.hero-float-2 { animation: float 6s ease-in-out infinite 2s; }
.hero-float-3 { animation: float 6s ease-in-out infinite 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-20px); }
}

/* ============================================
   12. MARQUEE
   ============================================ */
.marquee {
    animation: marquee 40s linear infinite;
}
@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   13. PULSE RING
   ============================================ */
.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulseRing {
    0%   { transform: scale(1);   opacity: 1; }
    100% { transform: scale(2);   opacity: 0; }
}

/* ============================================
   14. COUNTER
   ============================================ */
.counter-number {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   15. SECTION DIVIDER
   ============================================ */
.section-divider {
    background: linear-gradient(90deg, transparent, rgba(26, 115, 232, 0.3), transparent);
    height: 1px;
}

/* ============================================
   16. SEARCH
   ============================================ */
.search-glow:focus-within {
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1), 0 10px 40px rgba(26, 115, 232, 0.2);
}
#searchBtn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}
#domainSearch:focus {
    box-shadow: none;
}

/* ============================================
   17. PRIVACY / PROTECTION ANIMATIONS
   ============================================ */
.data-row { position: relative; overflow: hidden; }
.data-row.protected {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7) !important;
    border-color: #86efac !important;
}
.data-row.protected .status-icon {
    color: #10b981 !important;
    animation: checkPulse 0.5s ease;
}
@keyframes checkPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.3); }
}

#privacyCard.protected {
    box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.25);
}
#shieldIcon.activated {
    animation: shieldGlow 2s ease-in-out infinite;
}
@keyframes shieldGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
        transform: scale(1.05);
    }
}

.data-value {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#activationMsg {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.protection-bar {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   18. TAB BUTTONS
   ============================================ */
.tab-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-btn.active {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.service-card.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.service-card.entering {
    animation: cardEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ============================================
   19. PARTNER LOGO
   ============================================ */
.partner-logo {
    transition: all 0.3s ease;
}
.partner-logo:hover {
    transform: translateY(-4px);
    background: #fff;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}

/* ============================================
   20. CUSTOM SCROLLBAR (GLOBAL)
   ============================================ */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb {
    background: #1a73e8;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: #185abc; }

/* ============================================
   21. BODY LOCK WHEN MENU OPEN
   ============================================ */
body.menu-open {
    overflow: hidden !important;
}

/* ============================================
   22. FOCUS STATES (ACCESSIBILITY)
   ============================================ */
.nav-link:focus,
.mega-menu a:focus,
.drawer-nav-link:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   23. RESPONSIVE - TABLET (768px – 1023px)
   ============================================ */
@media (max-width: 1023px) and (min-width: 768px) {
    .mega-dropdown {
        width: 90vw;
        max-width: 720px;
    }
    .mega-menu > div:last-child {
        display: none;
    }
}

/* ============================================
   24. RESPONSIVE - MOBILE (< 768px)
   ============================================ */
@media (max-width: 767px) {

    /* Hide desktop nav items */
    .desktop-nav { display: none !important; }

    /* Show hamburger */
    .mobile-toggle { display: flex !important; }

    /* Mega dropdown: full-width fixed */
    .mega-dropdown {
        position: fixed;
        top: 70px;
        left: 1rem;
        right: 1rem;
        width: auto;
        max-width: none;
        transform: translateY(8px);
    }
    .nav-item:hover .mega-dropdown,
    .nav-item.group:hover .mega-dropdown {
        transform: translateY(0);
    }
    .mega-menu {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding: 1.5rem;
    }
    .mega-menu .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .mega-menu > div:last-child {
        display: none;
    }

    /* Hero text sizing */
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    .hero-subtitle {
        font-size: 1rem !important;
    }

    /* Stack grid columns */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }

    /* Reduce padding */
    .section-padding {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    /* Code editor mobile fix */
    .code-editor pre,
    .terminal-container pre {
        font-size: 0.75rem;
        padding: 1rem;
    }
}

/* ============================================
   25. RESPONSIVE - SMALL MOBILE (< 480px)
   ============================================ */
@media (max-width: 479px) {
    .mobile-menu {
        max-width: 100%;
    }
    .hero-title {
        font-size: 1.625rem !important;
    }
    .btn-primary {
        width: 100%;
        text-align: center;
    }
}