@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;900&display=swap');

@font-face {
    font-family: 'Rabar_038';
    src: url('../Rabar_038/Rabar_038.eot');
    src: url('../Rabar_038/Rabar_038.eot?#iefix') format('embedded-opentype'),
         url('../Rabar_038/Rabar_038.woff') format('woff'),
         url('../Rabar_038/Rabar_038.ttf') format('truetype'),
         url('../Rabar_038/Rabar_038.svg#Rabar_038') format('svg');
    font-weight: normal;
    font-style: normal;
}

/* Allow clicks to pass through cursor/extension overlays (e.g. Cursor preview) */
[data-cursor-element-id]:not(.theme-toggle) {
    pointer-events: none !important;
}

/* Base Styles handled by Tailwind classes in HTML now for theming */
html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    min-width: 0; /* allow flex/grid children to shrink */
}

/* Responsive: prevent horizontal overflow (do not set height: auto so object-cover cards keep aspect) */
img, video, iframe, object, embed {
    max-width: 100%;
}
img, video {
    display: block;
}
/* Standalone images without object-cover can shrink with aspect ratio */
img:not([class*="object-cover"]):not([class*="object-contain"]),
video:not([class*="object-cover"]):not([class*="object-contain"]) {
    height: auto;
}

/* Long words/URLs wrap instead of overflowing (especially RTL) */
body {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive containers: use with max-w-* for auto-width feel on large screens */
.container-responsive {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
    background: rgba(10, 25, 47, 0.85); /* navy-900 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Light Mode Glass Override */
html:not(.dark) .glass-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 40px -10px rgba(148, 163, 184, 0.2);
    color: #0f172a; /* slate-900 */
}

/* Dark Mode Glass */
.dark .glass-card {
    background: rgba(17, 34, 64, 0.7); /* navy-800 */
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
}

.glass-card {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -15px rgba(148, 163, 184, 0.3);
}
.dark .glass-card:hover {
    box-shadow: 0 20px 30px -15px rgba(2, 12, 27, 0.8);
    border-color: rgba(230, 0, 0, 0.3); /* brand-red */
}

.glass-nav {
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Typography Utilities */
.text-gradient {
    background: linear-gradient(135deg, #e60000 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-white {
    background: linear-gradient(135deg, #e6f1ff 0%, #8892b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom Utilities */
.hero-clip {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

/* Hero Grid Pattern - Animated 3D Perspective Grid */
@keyframes hero-grid-flow {
    0%, 100% { background-position: 0 0, 0 0, 0 0, 0 0; }
    50% { background-position: 36px 0, 0 36px, 72px 0, 0 72px; }
}
@keyframes hero-grid-glow {
    0%, 100% { opacity: 0.4; transform: rotateX(58deg) scale(2.2); }
    50% { opacity: 0.7; transform: rotateX(58deg) scale(2.25); }
}
@keyframes hero-grid-shimmer {
    0% { left: -100%; opacity: 0; }
    20% { opacity: 0.15; }
    50% { left: 100%; opacity: 0.08; }
    80% { opacity: 0.12; }
    100% { left: -100%; opacity: 0; }
}
@keyframes hero-grid-glow-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.hero-grid-pattern {
    position: relative;
    perspective: 1200px;
    overflow: hidden;
    background-image: 
        linear-gradient(to right, rgba(148, 163, 184, 0.18) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.18) 1px, transparent 1px),
        linear-gradient(to right, rgba(230, 0, 0, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(230, 0, 0, 0.08) 1px, transparent 1px);
    background-size: 36px 36px, 36px 36px, 144px 144px, 144px 144px;
    background-position: 0 0, 0 0, 0 0, 0 0;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 35%, black 15%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 35%, black 15%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
    transform: rotateX(58deg) scale(2.2);
    transform-origin: center 30%;
    animation: hero-grid-flow 20s ease-in-out infinite, hero-grid-glow 8s ease-in-out infinite;
}
.hero-grid-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(230, 0, 0, 0.03) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(230, 0, 0, 0.03) 75%,
        transparent 100%
    );
    animation: hero-grid-shimmer 12s ease-in-out infinite;
    pointer-events: none;
}
.hero-grid-pattern::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 50%;
    width: 140%;
    height: 70%;
    background: radial-gradient(
        ellipse at center,
        rgba(230, 0, 0, 0.08) 0%,
        rgba(230, 0, 0, 0.03) 35%,
        transparent 65%
    );
    transform: translateX(-50%);
    animation: hero-grid-glow-pulse 8s ease-in-out infinite;
    pointer-events: none;
}
html.dark .hero-grid-pattern {
    background-image: 
        linear-gradient(to right, rgba(241, 245, 249, 0.22) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(241, 245, 249, 0.22) 1px, transparent 1px),
        linear-gradient(to right, rgba(230, 0, 0, 0.10) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(230, 0, 0, 0.10) 1px, transparent 1px),
        linear-gradient(135deg, rgba(167, 139, 250, 0.04) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
    background-size: 36px 36px, 36px 36px, 144px 144px, 144px 144px, 72px 72px, 72px 72px;
}
html.dark .hero-grid-pattern::before {
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(230, 0, 0, 0.08) 20%,
        rgba(167, 139, 250, 0.06) 40%,
        rgba(255, 255, 255, 0.07) 50%,
        rgba(6, 182, 212, 0.05) 60%,
        rgba(230, 0, 0, 0.06) 80%,
        transparent 100%
    );
}
html.dark .hero-grid-pattern::after {
    background: radial-gradient(
        ellipse 80% 60% at 50% 30%,
        rgba(230, 0, 0, 0.12) 0%,
        rgba(167, 139, 250, 0.06) 25%,
        rgba(230, 0, 0, 0.04) 45%,
        rgba(6, 182, 212, 0.02) 60%,
        transparent 80%
    );
}

.service-card-overlay {
    background: linear-gradient(to top, rgba(2, 12, 27, 0.95), rgba(2, 12, 27, 0.5), transparent);
}

.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(90deg, #e60000, #ff6b6b);
    transition: width 0.3s ease-in-out;
}
.nav-link:hover::after {
    width: 100%;
}

/* Animation Delays */
.animation-delay-2000 {
    animation-delay: 2s;
}
.animation-delay-4000 {
    animation-delay: 4s;
}

/* Language Fonts */
.font-arabic, .font-kurdish {
    font-family: 'Rabar_038', 'Outfit', sans-serif;
}

/* Force Rabar font for Arabic and Kurdish languages globally */
:lang(ar) body, :lang(ku) body,
:lang(ar) .font-sans, :lang(ku) .font-sans {
    font-family: 'Rabar_038', 'Outfit', sans-serif !important;
}

/* Light Mode Background Enhancements */
html:not(.dark) .bg-pattern-grid {
    background-color: #f8fafc;
    background-image: linear-gradient(rgba(226, 232, 240, 0.6) 1px, transparent 1px),
                      linear-gradient(to right, rgba(226, 232, 240, 0.6) 1px, transparent 1px);
    background-size: 40px 40px;
}

html:not(.dark) .bg-pattern-dots {
    background-color: #ffffff;
    background-image: radial-gradient(rgba(203, 213, 225, 0.5) 1px, transparent 1px);
    background-size: 24px 24px;
}

html:not(.dark) .bg-soft-gradient {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

/* Marquee Animation */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    animation: marquee 35s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

/* Trusted Brands - Logo cards */
#trusted-brands .brand-logo-card img,
#trusted-brands .brand-text-card {
    min-height: 80px;
}

#trusted-brands .brand-logo-card:hover,
#trusted-brands .brand-text-card:hover {
    box-shadow: 0 20px 40px -15px rgba(230, 0, 0, 0.15);
}

.dark #trusted-brands .brand-logo-card:hover,
.dark #trusted-brands .brand-text-card:hover {
    box-shadow: 0 20px 40px -15px rgba(230, 0, 0, 0.25);
}

/* Trusted brands title - ensure muted gray in light mode, not black */
#trusted-brands .trusted-brands-title {
    color: #475569; /* slate-600 - muted gray */
}
.dark #trusted-brands .trusted-brands-title {
    color: #94a3b8; /* slate-400 */
}

/* --- Reusable Animations --- */

/* F1 Tech Scanning Animation */
@keyframes tech-scan {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}
.animate-tech-scan {
    animation: tech-scan 3s linear infinite;
}

/* Pulse Ring Animation for Hotspots */
@keyframes pulse-ring {
    0% { transform: scale(0.33); opacity: 1; }
    80%, 100% { transform: scale(1); opacity: 0; }
}
.animate-pulse-ring {
    animation: pulse-ring 3s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

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

.animate-float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.animate-float-icon-1 { animation: float-icon 4s ease-in-out infinite; }
.animate-float-icon-2 { animation: float-icon 5s ease-in-out infinite 1s; }
.animate-float-icon-3 { animation: float-icon 6s ease-in-out infinite 2s; }

@keyframes bg-pan {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

.animate-bg-pan {
    animation: bg-pan 60s linear infinite;
}

@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

.animate-blob {
    animation: blob 7s infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.animate-pulse-glow {
    animation: pulse-glow 3s infinite;
}

/* Business Section - Gradient text animation */
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.animate-gradient-shift {
    animation: gradient-shift 4s ease infinite;
}

/* Business form card entrance */
#business-inquiry .business-form-card {
    animation: fadeSlideUp 0.8s ease-out;
}
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Page header hero background (About etc.) --- */
.header-hero-bg {
    --header-bg-opacity: 0.22;
    animation: header-hero-reveal 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards,
               header-ken-burns 28s ease-in-out 1.6s infinite;
    transform-origin: center center;
    will-change: transform;
}
html.dark .header-hero-bg {
    --header-bg-opacity: 0.18;
}
@keyframes header-hero-reveal {
    from {
        opacity: 0;
        transform: scale(1.04);
    }
    to {
        opacity: var(--header-bg-opacity);
        transform: scale(1);
    }
}
@keyframes header-ken-burns {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}
.header-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 100% 80% at 50% 50%,
        transparent 30%,
        rgba(15, 23, 42, 0.12) 70%,
        rgba(15, 23, 42, 0.25) 100%
    );
    pointer-events: none;
}
html.dark .header-hero-bg::after {
    background: radial-gradient(
        ellipse 100% 80% at 50% 50%,
        transparent 25%,
        rgba(0, 0, 0, 0.2) 60%,
        rgba(0, 0, 0, 0.45) 100%
    );
}
