/* ═══════════════════════════════════════════════════════════
   POLYGOTT LANDING PAGE — Custom CSS
   Complements Tailwind CSS utility classes
   ═══════════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: rgba(46, 134, 193, 0.2);
    color: inherit;
}

/* ─── Navbar ───────────────────────────────────────────── */
#navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark #navbar {
    background: rgba(2, 6, 23, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

#navbar.scrolled {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.dark #navbar.scrolled {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ─── Hero Section ─────────────────────────────────────── */
.hero-gradient {
    background: 
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(46, 134, 193, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

.dark .hero-gradient {
    background: 
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(46, 134, 193, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
}

.hero-gradient-text {
    background-size: 300% 300%;
    animation: gradient 8s ease infinite;
}

/* ─── Scroll Reveal ────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Product Cards ────────────────────────────────────── */
.product-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.dark .product-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ─── Capability Cards Glow ────────────────────────────── */
.group:hover .w-11 {
    transition: all 0.3s ease;
}

/* ─── Particle Canvas ──────────────────────────────────── */
#particleCanvas {
    opacity: 0.5;
}

.dark #particleCanvas {
    opacity: 0.3;
}

/* ─── Language Dropdown ────────────────────────────────── */
#langDropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option.active {
    background: rgba(46, 134, 193, 0.08);
    color: #2E86C1;
    font-weight: 600;
}

.dark .lang-option.active {
    background: rgba(46, 134, 193, 0.15);
    color: #47A5DB;
}

/* ─── Counter Animation ────────────────────────────────── */
.counter {
    font-variant-numeric: tabular-nums;
}

/* ─── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ─── Focus States (A11y) ──────────────────────────────── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #2E86C1;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ─── RTL Support (Arabic) ─────────────────────────────── */
[dir="rtl"] .flex {
    direction: rtl;
}

[dir="rtl"] .group-hover\/link\:translate-x-0\.5:hover {
    transform: translateX(-2px);
}

/* ─── Mobile Menu Animation ────────────────────────────── */
#mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease;
    opacity: 0;
}

#mobileMenu.open {
    max-height: 400px;
    opacity: 1;
    display: block;
}

/* ─── Gradient Animation Helpers ───────────────────────── */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ─── CTA Section Pattern ──────────────────────────────── */
#cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* ─── Responsive Breakpoints ───────────────────────────── */
@media (max-width: 640px) {
    .hero-gradient-text {
        font-size: inherit;
    }
    
    #hero h1 {
        font-size: 2.25rem;
        line-height: 1.15;
    }
}

@media (max-width: 1024px) {
    /* Adjust product cards for tablet */
    .product-card:hover {
        transform: translateY(-2px);
    }
}

/* ─── Print Styles ─────────────────────────────────────── */
@media print {
    #navbar,
    #particleCanvas,
    .animate-float,
    .animate-float-delayed,
    .animate-pulse-slow {
        display: none !important;
    }
    
    body {
        color: #000 !important;
        background: #fff !important;
    }
    
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ─── Reduced Motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}
