/* ============================================
   PROFILE MK — Base Styles
   Glassmorphism Foundation
   ============================================ */

/* ─────────────────────────────────────────
   FONT IMPORTS
   ───────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Sora:wght@300;400;500;600;700;800&display=swap');

/* ─────────────────────────────────────────
   MODERN CSS RESET
   ───────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-size: 16px;
}

html,
body {
    height: 100%;
    overflow-x: hidden !important;
    width: 100%;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

/* ─────────────────────────────────────────
   TYPOGRAPHY
   ───────────────────────────────────────── */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
    /* GSAP Stability Fixes */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;

    /* Ensure text is always on top */
    position: relative;
    z-index: 9999;
}

h1 {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-6);
}

h2 {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-4);
}

h3 {
    font-size: var(--text-3xl);
}

h4 {
    font-size: var(--text-2xl);
}

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
    position: relative;
    z-index: 9999;
}

p:last-child {
    margin-bottom: 0;
}

.lead {
    font-size: var(--text-xl);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────
   ENHANCED TEXT EFFECTS
   ───────────────────────────────────────── */

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-animated {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-gold) 25%, var(--color-secondary) 50%, var(--color-accent-coral) 75%, var(--color-primary) 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.text-glow {
    text-shadow: 0 0 20px var(--color-primary-glow), 0 0 40px var(--color-primary-glow);
}

.text-glow-gold {
    text-shadow: 0 0 20px var(--color-accent-gold-glow), 0 0 40px var(--color-accent-gold-glow);
}

/* Animated underline effect */
.text-underline-animated {
    position: relative;
    display: inline-block;
}

.text-underline-animated::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-ocean);
    border-radius: 2px;
    transition: width 0.4s var(--ease-out);
}

.text-underline-animated:hover::after {
    width: 100%;
}

a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--color-primary);
    text-shadow: 0 0 10px var(--color-primary-glow);
}

/* ─────────────────────────────────────────
   LISTS
   ───────────────────────────────────────── */

ul,
ol {
    list-style: none;
}

/* ─────────────────────────────────────────
   IMAGES & MEDIA
   ───────────────────────────────────────── */

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ─────────────────────────────────────────
   FORM ELEMENTS
   ───────────────────────────────────────── */

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: inherit;
    color: inherit;
    margin: 0;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

/* ─────────────────────────────────────────
   SELECTION
   ───────────────────────────────────────── */

::selection {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* ─────────────────────────────────────────
   SCROLLBAR — Glassmorphism Style
   ───────────────────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-bg-strong);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-glow);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--glass-bg-strong) var(--bg-secondary);
}

/* ─────────────────────────────────────────
   LAYOUT UTILITIES
   ───────────────────────────────────────── */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--section-padding-x);
    padding-right: var(--section-padding-x);
}

.container-narrow {
    max-width: var(--container-narrow);
}

.container-wide {
    width: 100%;
    max-width: var(--container-wide);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--section-padding-x);
    padding-right: var(--section-padding-x);
}

section,
.section {
    padding-top: var(--section-padding-y);
    padding-bottom: var(--section-padding-y);
}

/* ─────────────────────────────────────────
   RESPONSIVE TYPOGRAPHY & SPACING
   ───────────────────────────────────────── */

/* Tablet */
@media (max-width: 992px) {
    html {
        font-size: 15px;
    }

    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-3xl);
    }

    h3 {
        font-size: var(--text-2xl);
    }

    section,
    .section {
        padding-top: clamp(80px, 10vw, 120px);
        padding-bottom: clamp(80px, 10vw, 120px);
    }
}

/* Mobile */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }

    h3 {
        font-size: var(--text-xl);
    }

    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    section,
    .section {
        padding-top: var(--space-12);
        padding-bottom: var(--space-12);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    h1 {
        font-size: var(--text-2xl);
    }

    h2 {
        font-size: var(--text-xl);
    }

    .container {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }

    section,
    .section {
        padding-top: var(--space-10);
        padding-bottom: var(--space-10);
    }
}

/* ─────────────────────────────────────────
   FLEX UTILITIES
   ───────────────────────────────────────── */

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

.gap-12 {
    gap: var(--space-12);
}

/* ─────────────────────────────────────────
   GRID UTILITIES
   ───────────────────────────────────────── */

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .md\:grid-cols-1 {
        grid-template-columns: repeat(1, 1fr);
    }

    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .sm\:grid-cols-1 {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* SCROLL PROGRESS BAR */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--gradient-premium);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--color-primary);
}

/* ─────────────────────────────────────────
   TEXT UTILITIES
   ───────────────────────────────────────── */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-accent {
    color: var(--color-primary);
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
}

/* ─────────────────────────────────────────
   SPACING UTILITIES
   ───────────────────────────────────────── */

.mt-auto {
    margin-top: auto;
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.mb-12 {
    margin-bottom: var(--space-12);
}

.pt-0 {
    padding-top: 0;
}

.pb-0 {
    padding-bottom: 0;
}

/* ─────────────────────────────────────────
   VISIBILITY UTILITIES
   ───────────────────────────────────────── */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .md\:hidden {
        display: none;
    }
}

@media (min-width: 769px) {
    .md\:block {
        display: block;
    }
}

/* ─────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─────────────────────────────────────────
   LENIS SMOOTH SCROLL
   ───────────────────────────────────────── */

html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* ─────────────────────────────────────────
   MAGIC CURSOR
   ───────────────────────────────────────── */

.magic-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 1px solid var(--color-primary-light);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background 0.3s ease;
    mix-blend-mode: difference;
}

.magic-cursor-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.magic-cursor.hovering {
    width: 50px;
    height: 50px;
    background: rgba(130, 36, 227, 0.2);
    border-color: transparent;
    mix-blend-mode: normal;
}

.magic-cursor.clicking {
    transform: scale(0.8);
}

/* Hide custom cursor on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {
    .magic-cursor {
        display: none;
    }
}

/* ─────────────────────────────────────────
   MISSING UTILITIES (Fixing Broken Pages)
   ───────────────────────────────────────── */

/* Layout & Flex Aliases */
.d-flex {
    display: flex;
}

.flex-row {
    flex-direction: row;
}

.flex-column {
    flex-direction: column;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.w-full {
    width: 100%;
}

.w-fit {
    width: fit-content;
}

.h-full {
    height: 100%;
}

/* Grid Aliases */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Padding */
.p-0 {
    padding: 0;
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

.p-12 {
    padding: var(--space-12);
}

.px-6 {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.py-4 {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

/* Margin */
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.my-4 {
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mt-12 {
    margin-top: var(--space-12);
}

/* Typography */
.font-bold {
    font-weight: var(--font-bold);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

.text-xl {
    font-size: var(--text-xl);
}

.display-1 {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    line-height: 1.1;
}

.display-2 {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
}

/* Borders & Radius */
.rounded-full {
    border-radius: 9999px;
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

.border-glass {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Backgrounds */
.bg-transparent {
    background: transparent;
}

.bg-glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.overflow-hidden {
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* Spacing Helpers */
.space-y-4>*+* {
    margin-top: var(--space-4);
}

.space-y-8>*+* {
    margin-top: var(--space-8);
}

/* ═══════════════════════════════════════════════════════════════
   COMPREHENSIVE MOBILE RESPONSIVE FIXES
   ═══════════════════════════════════════════════════════════════ */

/* Prevent horizontal scroll on all pages */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ─────────────────────────────────────────
   MOBILE BREAKPOINT: 576px and below
   ───────────────────────────────────────── */
@media (max-width: 576px) {

    /* Floating Status Badge - hide on small mobile to prevent overlap */
    .status-badge-floating {
        display: none !important;
    }

    /* Hero Section Fixes */
    .hero-cinematic {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .hero-actions,
    .hero-actions.actions-group {
        flex-direction: column !important;
        align-items: center !important;
        gap: var(--space-3) !important;
        width: 100%;
        padding: 0 var(--space-2);
    }

    .hero-actions .btn,
    .hero-actions .btn-premium,
    .hero-actions .btn-outline {
        width: 100% !important;
        max-width: 280px !important;
        justify-content: center;
    }

    /* Authority Section - Better padding */
    .authority-content,
    .authority-inner {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .authority-title,
    .authority-text {
        padding-left: var(--space-2);
        padding-right: var(--space-2);
    }

    /* Footer - Add bottom padding for WhatsApp button */
    .footer {
        padding-bottom: 100px !important;
    }

    .footer-bottom {
        padding-bottom: var(--space-16);
    }

    /* WhatsApp Float - Adjust position */
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    /* Ensure all containers have safe padding */
    .container {
        padding-left: var(--space-4) !important;
        padding-right: var(--space-4) !important;
    }

    /* Portfolio slider on mobile */
    .swiper-slide {
        width: 90% !important;
    }

    /* Project cards on mobile */
    .project-slide {
        border-radius: var(--radius-xl);
    }

    .project-overlay {
        padding: var(--space-4);
    }

    .project-title {
        font-size: var(--text-lg);
    }

    /* Slider navigation */
    .slider-navigation {
        gap: var(--space-3);
    }

    .slider-btn {
        width: 44px;
        height: 44px;
    }

    /* Premium badge smaller on mobile */
    .premium-badge {
        font-size: 10px;
        padding: 6px 12px;
    }

    /* Section headers */
    .section-header {
        padding-left: var(--space-2);
        padding-right: var(--space-2);
    }

    /* Service cards stack properly */
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-4);
    }

    /* Process steps stack */
    .process-grid {
        grid-template-columns: 1fr !important;
    }

    .process-step {
        transform: none !important;
    }

    /* Testimonial cards */
    .testimonial-card-premium {
        padding: var(--space-6);
    }

    .testimonial-content {
        font-size: var(--text-base);
    }

    /* CTA Section */
    .cta-inner,
    .portfolio-cta-inner {
        padding: var(--space-8) var(--space-4);
        border-radius: var(--radius-xl);
    }

    .cta-title {
        font-size: var(--text-xl);
    }

    .cta-description {
        font-size: var(--text-sm);
    }
}

/* ─────────────────────────────────────────
   MOBILE BREAKPOINT: 768px and below
   ───────────────────────────────────────── */
@media (max-width: 768px) {

    /* Status Badge - smaller and less intrusive */
    .status-badge-floating {
        bottom: 15px;
        left: 15px;
        padding: 6px 12px;
        font-size: 11px;
    }

    .status-text {
        font-size: 11px;
    }

    /* Authority Section Image */
    .authority-image-wrapper,
    .premium-image-wrapper {
        max-width: 300px;
        margin: 0 auto;
    }

    .authority-visual {
        margin-bottom: var(--space-8);
    }

    /* Footer Grid - Stack columns */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-8);
        text-align: center;
    }

    .footer-list {
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    /* Navbar adjustments */
    .navbar-contact-link span {
        display: none;
    }

    .navbar-logo {
        max-width: 60px;
    }

    /* ─────────────────────────────────────────
       IMPROVED MOBILE HEADER STYLES
       ───────────────────────────────────────── */

    /* Hide "CLICK" text on mobile - save space */
    .toggle-text {
        display: none !important;
    }

    /* Improve navbar toggle button on mobile */
    .navbar-toggle {
        padding: 0 12px;
        height: 44px;
        gap: 0;
    }

    /* Navbar inner - better mobile spacing and layout */
    .navbar-inner {
        padding: var(--space-2) var(--space-3);
        gap: var(--space-2);
        /* Keep 3-column grid so logo stays centered */
        grid-template-columns: 1fr auto 1fr;
    }

    /* Navbar left - invisible placeholder to balance the grid */
    .navbar-left {
        visibility: hidden;
        width: 44px;
        /* Same width as toggle button */
    }

    /* Navbar logo - slightly larger on mobile for visibility */
    .navbar-logo {
        height: 36px;
        max-width: none;
    }

    /* Hide contact link completely on mobile */
    .navbar-contact-link {
        display: none !important;
    }

    .navbar-contact-link svg {
        width: 18px;
        height: 18px;
    }
}