/* ============================================================================
   SAAIQ Landing Page - Custom Styles
   ============================================================================ */

/* Base Styles */
* {
    font-family: 'Cairo', 'system-ui', sans-serif;
}

:root {
    --cursor-stroke: #A19C65;
    --cursor-stroke-width: 2.25px;
    --glitch-accent: #A19C65;
    --cursor-fill: #F6F1D1;
}

body {
    overflow-x: hidden;
    cursor: none;
}

/* ============================================================================
   Crosshair Cursor Styles
   ============================================================================ */

.cursor {
    display: none;
}

@media (any-pointer: fine) {
    .cursor {
        position: fixed;
        top: 0;
        left: 0;
        display: block;
        pointer-events: none;
        z-index: 1001;
    }

    .cursor__icon {
        position: fixed;
        width: 64px;
        height: 64px;
        transform: translate(-50%, -50%) rotate(-8deg);
        will-change: transform, opacity, filter;
        opacity: 0;
    }

    .cursor__icon-shape {
        fill: var(--cursor-fill);
        stroke: var(--cursor-stroke);
        stroke-width: var(--cursor-stroke-width);
        filter: drop-shadow(0 0 14px rgba(161, 156, 101, 0.65));
    }
}

.glitch-hover {
    position: relative;
}

.glitch-hover .word {
    display: inline-block;
    will-change: transform, color;
}

.hero-title {
    margin-bottom: 0.1em;
}

.hero-subtitle {
    margin-top: -0.15em;
}

.hero-font {
    font-family: 'IBM Plex Sans Arabic', 'Cairo', 'system-ui', sans-serif !important;
    letter-spacing: -0.01em;
}
.hero-font * {
    font-family: 'IBM Plex Sans Arabic', 'Cairo', 'system-ui', sans-serif !important;
}
.glitch-hero-font {
    font-family: 'Changa', 'IBM Plex Sans Arabic', 'Cairo', 'system-ui', sans-serif !important;
    letter-spacing: -0.005em;
}
.glitch-hero-font * ,
.glitch-hero-font .word {
    font-family: 'Changa', 'IBM Plex Sans Arabic', 'Cairo', 'system-ui', sans-serif !important;
    font-weight: 600 !important;
}

.hero-title,
.hero-subtitle {
    font-family: 'IBM Plex Sans Arabic', 'Cairo', 'system-ui', sans-serif !important;
}

.glitch-hover.glitch-hero-font .word {
    font-family: 'Changa', 'IBM Plex Sans Arabic', 'Cairo', 'system-ui', sans-serif !important;
    font-weight: 700 !important;
}

/* Hero animated blobs */
.hero-blobs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.hero-blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(60px);
    opacity: 0.22;
    animation: blobFloat 14s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

.blob-1 {
    width: 32rem;
    height: 32rem;
    background: rgba(2, 58, 41, 0.55);
    top: -8rem;
    left: -6rem;
    animation-duration: 16s;
}

.blob-2 {
    width: 24rem;
    height: 24rem;
    background: rgba(161, 156, 101, 0.45);
    bottom: -6rem;
    right: -4rem;
    animation-duration: 13s;
    animation-delay: 2s;
}

.blob-3 {
    width: 18rem;
    height: 18rem;
    background: rgba(2, 58, 41, 0.4);
    top: 30%;
    right: 35%;
    animation-duration: 11s;
    animation-delay: 1s;
}

@keyframes blobFloat {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.2;
    }
    50% {
        transform: translate3d(12px, -10px, 0) scale(1.05);
        opacity: 0.28;
    }
    100% {
        transform: translate3d(-16px, 16px, 0) scale(1.12);
        opacity: 0.34;
    }
}

.store-btn {
    width: 220px;
    justify-content: space-between;
    padding: 0.85rem 1.35rem !important;
    font-size: 0.95rem;
    gap: 0.5rem;
}
.store-btn i {
    font-size: 1.35rem !important;
}

@media (max-width: 640px) {
    .store-btn {
        width: 45%;
        padding: 0.78rem 0.9rem !important;
        font-size: 0.9rem;
    }
    .store-btn i {
        font-size: 1.1rem !important;
    }
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.gradient-bg {
    background: linear-gradient(135deg, #023A29 0%, #002318 100%);
}

.gradient-text {
    background: linear-gradient(135deg, #023A29 0%, #002318 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-pattern {
    background: linear-gradient(135deg, #023A29 0%, #002318 100%);
    position: relative;
    overflow: hidden;
}

/* ============================================================================
   Parallax Effects
   ============================================================================ */

.parallax-element {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.scroll-smooth {
    scroll-behavior: smooth;
}

/* ============================================================================
   Navigation Bar Styles
   ============================================================================ */

.nav-bar {
    background: transparent;
    backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    opacity: 1;
}

/* Navigation colors when transparent (at top) */
.nav-logo-text {
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.nav-button {
    background: rgba(255, 255, 255, 0.95);
    color: #023A29;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-button:hover {
    background: white;
    color: #023A29;
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

/* Navigation colors when scrolled (with background) */
.nav-bar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-bar.scrolled .nav-logo {
    transform: scale(0.95);
}

.nav-bar.scrolled .nav-logo-text {
    color: #023A29;
    text-shadow: none;
}

.nav-bar.scrolled .nav-link {
    color: #6C757D;
    text-shadow: none;
}

.nav-bar.scrolled .nav-link:hover {
    color: #023A29;
}

.nav-bar.scrolled .nav-button {
    background: linear-gradient(135deg, #023A29 0%, #002318 100%);
    color: white;
    border: 2px solid transparent;
}

.nav-bar.scrolled .nav-button:hover {
    background: linear-gradient(135deg, #023A29 0%, #002318 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(2, 58, 41, 0.3);
}

/* Navigation Logo */
.nav-logo {
    transition: transform 0.3s ease;
    animation: navLogoSlideIn 0.8s ease-out;
}

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

.logo-container {
    transition: transform 0.3s ease;
}

.logo-image {
    object-fit: contain;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: logoFadeIn 0.6s ease-out 0.2s forwards;
    opacity: 0;
}

/* Logo entrance animation */
@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Logo hover effects */
.logo-container:hover .logo-image {
    transform: scale(1.15) rotate(8deg);
    filter: brightness(1.15) drop-shadow(0 6px 16px rgba(2, 58, 41, 0.4));
}

.logo-container:hover {
    transform: translateY(-2px);
}

/* Logo subtle glow effect on hover */
.logo-container:hover .logo-image {
    box-shadow: 0 0 20px rgba(161, 156, 101, 0.3);
}

/* Navigation Menu */
.nav-menu {
    animation: navMenuSlideIn 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

@keyframes navMenuSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Navigation Links */
.nav-link {
    position: relative;
    padding: 0.5rem 0;
    animation: navLinkFadeIn 0.6s ease-out 0.4s forwards;
    opacity: 0;
}

@keyframes navLinkFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, white, rgba(255, 255, 255, 0.8));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-bar.scrolled .nav-link::after {
    background: linear-gradient(90deg, #023A29, #A19C65);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* Navigation Button */
.nav-button {
    animation: navButtonFadeIn 0.6s ease-out 0.6s forwards;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

@keyframes navButtonFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.nav-button:hover::before {
    width: 300px;
    height: 300px;
}

.nav-button:hover {
    box-shadow: 0 10px 30px rgba(2, 58, 41, 0.3);
    transform: scale(1.05) translateY(-2px);
}

/* Navigation bar scroll animations */
.nav-bar {
    will-change: transform, opacity, background, backdrop-filter;
}

/* Stagger animation for menu items */
.nav-menu > *:nth-child(1) {
    animation-delay: 0.4s;
}

.nav-menu > *:nth-child(2) {
    animation-delay: 0.6s;
}

/* Pulse animation for button on scroll */
.nav-bar.scrolled .nav-button {
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(2, 58, 41, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(2, 58, 41, 0.4);
    }
}

/* Logo image adjustments for transparency */
.nav-bar .logo-image {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.nav-bar.scrolled .logo-image {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

/* ============================================================================
   Animations
   ============================================================================ */

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

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-up-delay {
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.fade-in-up-delay-2 {
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

/* ============================================================================
   RTL Support
   ============================================================================ */

[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .space-x-3 > * + * {
    margin-right: 0.75rem;
    margin-left: 0;
}

[dir="rtl"] .space-x-8 > * + * {
    margin-right: 2rem;
    margin-left: 0;
}

[dir="rtl"] .text-left {
    text-align: right;
}

[dir="rtl"] .text-right {
    text-align: right;
}

/* ============================================================================
   Device Mockup - 3D Effects & Animations
   ============================================================================ */

.device-mockup-container {
    perspective: 1500px;
    perspective-origin: center center;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.device-mockup-wrapper {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.device-mockup-wrapper picture {
    display: block;
    width: 100%;
}

.device-mockup-image {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.4));
    border-radius: 2rem;
}

/* Glow effect layer */
.device-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    background: radial-gradient(ellipse at center, 
        rgba(161, 156, 101, 0) 0%,
        rgba(161, 156, 101, 0.1) 40%,
        rgba(2, 58, 41, 0.2) 70%,
        transparent 100%);
    border-radius: 3rem;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: blur(40px);
    pointer-events: none;
}

/* Hover Effects */
.device-mockup-container:hover .device-mockup-wrapper {
    transform: rotateY(-8deg) rotateX(5deg) scale(1.05);
}

.device-mockup-container:hover .device-mockup-image {
    transform: scale(1.02) translateZ(20px);
    filter: drop-shadow(0 30px 80px rgba(0, 0, 0, 0.5)) 
            drop-shadow(0 0 40px rgba(161, 156, 101, 0.3));
}

.device-mockup-container:hover .device-glow {
    opacity: 1;
    animation: glowPulse 2s ease-in-out infinite;
}

/* Glow pulse animation */
@keyframes glowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Entrance Animation */
.device-mockup-wrapper {
    animation: deviceFadeIn 1s ease-out 0.3s forwards;
    opacity: 0;
}

@keyframes deviceFadeIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9) rotateY(-10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotateY(0deg);
    }
}

/* Subtle float animation */
.device-mockup-image {
    animation: deviceFloat 6s ease-in-out infinite;
}

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

/* ============================================================================
   Responsive Adjustments
   ============================================================================ */

@media (max-width: 768px) {
    body {
        cursor: auto;
    }
    
    /* Hide desktop nav on mobile */
    .nav-bar {
        display: none;
    }
    
    .cursor {
        display: none !important;
    }
    
    .device-mockup-container {
        max-width: 320px;
        margin-top: 2rem;
    }
    
    .device-mockup-container:hover .device-mockup-wrapper {
        transform: none;
    }
    
    /* Disable float animation on mobile */
    .device-mockup-image {
        animation: none;
    }

    /* Hero text scaling */
    .hero-title {
        font-size: clamp(1.8rem, 6vw, 2.3rem);
        line-height: 1.25;
    }
    .hero-subtitle {
        font-size: clamp(1.4rem, 5vw, 2rem);
        line-height: 1.25;
        margin-top: -0.05em;
    }
    .hero-font,
    .hero-font * {
        font-weight: 600;
    }

    /* CTA buttons side by side on mobile */
    .store-btn {
        width: 45%;
        padding: 0.78rem 0.9rem !important;
        font-size: 0.9rem;
    }
    .store-btn i {
        font-size: 1.1rem !important;
    }

    /* Soften background blobs for mobile */
    .hero-blob {
        filter: blur(40px);
        opacity: 0.16;
    }
    .blob-1 { width: 18rem; height: 18rem; top: -4rem; left: -3rem; }
    .blob-2 { width: 14rem; height: 14rem; bottom: -3rem; right: -2rem; }
    .blob-3 { width: 12rem; height: 12rem; top: 35%; right: 20%; }

    /* Safe area / top spacing for mobile app bars */
    .hero-pattern {
        padding-top: calc(env(safe-area-inset-top, 0px) + 70px);
    }
}
