/* ============================================
   CRITICAL FIX: FORCE CONTENT VISIBILITY
   This ensures all content is visible immediately
   Prevents issues caused by animation libraries
   ============================================ */
body {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force all animated elements to be visible by default */
.text-reveal,
.blog-card,
.service-card,
.project-card,
.fade-in,
.slide-up,
[data-barba] {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Global Styles Extracted from Index */

body {
    background-color: #0a0a0a;
    color: #fff;
    overflow-x: hidden;
}

/* Navbar Styling */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 3rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.site-header.scrolled {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .site-header {
        padding: 1rem 1.5rem;
    }

    .site-header.scrolled {
        padding: 0.8rem 1.5rem;
    }
}

/* Mobile Menu Overlay */
.offcanvas-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: #0a0a0a;
    z-index: 95;
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

.offcanvas-menu.active {
    transform: translateX(0);
}

/* RTL Support for Offcanvas */
html[dir="rtl"] .offcanvas-menu {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

html[dir="rtl"] .offcanvas-menu.active {
    transform: translateX(0);
}


.menu-item-large {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
}

.menu-item-large:hover {
    color: #0052cc;
    padding-right: 20px;
    transform: translateX(5px);
}

/* Nav Links Common */
.nav-link {
    position: relative;
    /* padding-bottom: 5px; Removed to fix vertical centering */
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    /* Moved underline down outside the element box */
    width: 0;
    height: 2px;
    background: #0052cc;
    transition: width 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* LTR Specific */
html[dir="ltr"] .nav-link::after {
    left: 0;
}

/* RTL Specific */
html[dir="rtl"] .nav-link::after {
    right: 0;
}

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

/* Footer Links */
.footer-link {
    display: inline-block;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.footer-link:hover {
    color: #0052cc;
    transform: translateX(8px);
}

html[dir="rtl"] .footer-link:hover {
    transform: translateX(-8px);
}

/* Typography */
.hero-heading {
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.section-heading {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.2;
}

/* Swiper Customization (Continuous Strip) */
.swiper-wrapper {
    transition-timing-function: linear !important;
}

.swiper-slide {
    height: auto;
    display: flex;
    height: 100%;
    width: 400px;
}

@media (max-width: 768px) {
    .swiper-slide {
        width: 300px;
    }
}

/* Strip Layout Bleed */
.projects-strip {
    width: 100%;
    overflow: visible;
}

.project-card {
    background-color: #fff;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    /* Optimized: Only transition specific properties instead of 'all' */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    /* Performance: GPU acceleration */
    transform: translate3d(0, 0, 0);
    /* Performance: CSS containment for layout isolation */
    contain: layout style paint;
}

.project-card:hover {
    /* Reduced from -12px to -8px for less reflow */
    transform: translateY(-8px) translate3d(0, 0, 0);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.project-card__image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.project-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Reduced from 1.2s to 0.4s for snappier response */
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    /* Performance hint for browser */
    will-change: transform;
}

.project-card:hover .project-card__image img {
    /* Reduced from 1.08 to 1.05 */
    transform: scale(1.05);
}

.project-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    color: #0a0a0a;
    background: #fff;
    border-top: 1px solid #eee;
}

.project-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: #0a0a0a;
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    z-index: 2;
    letter-spacing: 0.05em;
}

/* Modal Styling */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 2rem;
}

.project-modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #fff;
    color: #0a0a0a;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: grid;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr;
    }
}

.project-modal.active .modal-content {
    transform: translateY(0);
}

.modal-image {
    height: 100%;
    min-height: 300px;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 3rem;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    color: #0a0a0a;
    padding: 0.5rem;
}

/* Blog Card Styling */
.blog-card {
    background: transparent;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.blog-card__image {
    height: 300px;
    overflow: hidden;
    border-radius: 0;
    position: relative;
    margin-bottom: 1.5rem;
}

.blog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.blog-card:hover .blog-card__image img {
    transform: scale(1.06);
}

.blog-meta {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0052cc;
    margin-bottom: 0.5rem;
    display: block;
}

/* Legacy / Utilities */
.text-reveal {
    opacity: 0;
    transform: translateY(30px);
}

.line-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Button Primary (for Modal) */
.btn-primary {
    display: inline-block;
    background-color: #0052cc;
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.875rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-primary:hover {
    background-color: #003d99;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
}

/* ============================================
   SIMPLE CSS ANIMATIONS (No GSAP needed)
   ============================================ */

/* Initial state for reveal elements */
.text-reveal,
.blog-card,
.service-card,
.project-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Visible state */
.text-reveal.visible,
.blog-card.visible,
.service-card.visible,
.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile: Disable animations for performance */
@media (max-width: 768px) {

    .text-reveal,
    .blog-card,
    .service-card,
    .project-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Optional: Add smooth hover transitions */
a,
button {
    transition: all 0.2s ease;
}

/* ============================================
   MOBILE OPTIMIZATION - ENHANCED Jan 2026
   ============================================ */

/* 1. FLUID TYPOGRAPHY & RATIOS
   Using clamp() to ensure text scales linearly between min and max viewports.
   No more huge headers on mobile. */
:root {
    --container-padding: 1.5rem;
}

@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
    }
}

/* Prevent horizontal scrolling & force vertical flow */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
    font-size: 16px;
    /* Base size for rem calculations */
}

/* 2. RESPONSIVE HEADINGS - Updated to NOT override Tailwind utility classes */
h1.hero-heading {
    font-size: clamp(2.5rem, 6vw + 1rem, 4.5rem);
    line-height: 1.1;
}

h2.section-heading {
    font-size: clamp(1.75rem, 4vw + 1rem, 2.5rem);
    line-height: 1.2;
}


h3.text-2xl {
    font-size: clamp(1.35rem, 3vw + 0.5rem, 2rem);
}

p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.6;
}

/* 3. LAYOUT & SPACING ADJUSTMENTS */
.container {
    padding-left: var(--container-padding) !important;
    padding-right: var(--container-padding) !important;
    width: 100% !important;
    max-width: 100% !important;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px !important;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px !important;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px !important;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px !important;
    }
}

@media (min-width: 1536px) {
    .container {
        max-width: 1536px !important;
    }
}

/* Fix section padding on mobile */
@media (max-width: 640px) {
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .gap-16 {
        gap: 2rem !important;
    }

    .gap-8 {
        gap: 1.5rem !important;
    }

    .mb-16 {
        margin-bottom: 2.5rem !important;
    }

    .mb-8 {
        margin-bottom: 1.5rem !important;
    }
}

/* 4. IMAGES & ASPECT RATIOS */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.aspect-video,
.aspect-\[4\/3\] {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 5. FORM & INTERACTIVE ELEMENTS (Touch Friendly) */
button,
.btn,
input,
select,
textarea,
.nav-link,
a.menu-item-large {
    min-height: 48px;
    /* Standard touch target size */
    touch-action: manipulation;
}

input,
textarea,
select {
    font-size: 16px !important;
    /* Prevents iOS zooom */
    padding: 12px 16px !important;
}

/* 6. ADMIN / FILAMENT TWEAKS (Frontend) */
/* Ensure filament tables scroll horizontally if needed */
.fi-ta-content {
    overflow-x: auto;
}

/* 7. RTL SPECIFIC FIXES (Mobile) */
html[dir="rtl"] .offcanvas-menu {
    transform: translateX(-100%);
    left: 0;
    right: auto;
}

html[dir="rtl"] .offcanvas-menu.active {
    transform: translateX(0);
}

/* Fix text alignment in cards for RTL */
html[dir="rtl"] .project-card__content,
html[dir="rtl"] .blog-card,
html[dir="rtl"] .modal-info {
    text-align: right;
}

/* 8. DISABLE ANIMATIONS ON MOBILE (Performance) */
@media (max-width: 768px) {

    .text-reveal,
    .project-card,
    .blog-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}