/* assets/css/style.css - MOBILE OPTIMIZED */

/* ============================================
   BASE STYLES & RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   MOBILE OPTIMIZATION - CRITICAL
   ============================================ */
@media (max-width: 640px) {
    html {
        font-size: 14px; /* Base font smaller on mobile */
    }

    body {
        overflow-x: hidden;
        position: relative;
        width: 100%;
    }

    /* Prevent horizontal scroll */
    section {
        overflow-x: hidden;
        max-width: 100vw;
    }
}

/* ============================================
   PRELOADER
   ============================================ */
#preloader {
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* ============================================
   GLASS EFFECTS - MOBILE OPTIMIZED
   ============================================ */
.glass {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reduce blur on mobile for performance */
@media (max-width: 768px) {
    .glass {
        backdrop-filter: blur(10px) saturate(160%);
        -webkit-backdrop-filter: blur(10px) saturate(160%);
    }
}

.glass:hover {
    background: rgba(20, 20, 20, 0.8);
    border-color: rgba(77, 97, 244, 0.3);
}

/* Remove hover effects on touch devices */
@media (hover: none) {
    .glass:hover {
        background: rgba(20, 20, 20, 0.6);
        border-color: rgba(255, 255, 255, 0.1);
        transform: none;
        box-shadow: none;
    }
}

@media (min-width: 769px) {
    .glass:hover {
        transform: translateY(-2px);
        box-shadow: 0 20px 60px rgba(77, 97, 244, 0.2);
    }
}

.glass-strong {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
    .glass-strong {
        backdrop-filter: blur(15px) saturate(160%);
        -webkit-backdrop-filter: blur(15px) saturate(160%);
    }
}

/* ============================================
   GRADIENT EFFECTS
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #d7fe7c 50%, #4d61f4 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 8s ease infinite;
}

.gradient-text-alt {
    background: linear-gradient(135deg, #4d61f4 0%, #d7fe7c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-border {
    position: relative;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.4s ease;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4d61f4, #d7fe7c, #4d61f4);
    background-size: 200% 100%;
    animation: gradient 3s linear infinite;
    border-radius: 12px 12px 0 0;
}

/* Disable gradient animation on mobile for performance */
@media (max-width: 768px) {
    .gradient-border::before {
        animation: none;
        background: linear-gradient(90deg, #4d61f4, #d7fe7c);
    }
}

.gradient-border::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, #4d61f4, transparent, #d7fe7c);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

@media (min-width: 769px) {
    .gradient-border:hover::after {
        opacity: 0.5;
    }
}

.gradient-bg {
    background: linear-gradient(135deg, rgba(77, 97, 244, 0.1) 0%, rgba(215, 254, 124, 0.1) 100%);
}

.gradient-bg-hover {
    transition: all 0.4s ease;
}

@media (min-width: 769px) {
    .gradient-bg-hover:hover {
        background: linear-gradient(135deg, rgba(77, 97, 244, 0.2) 0%, rgba(215, 254, 124, 0.2) 100%);
    }
}

/* ============================================
   MENU & NAVIGATION - MOBILE OPTIMIZED
   ============================================ */
.menu-link {
    display: block;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile touch optimization */
@media (max-width: 768px) {
    .menu-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
}

.menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4d61f4, #d7fe7c);
    transform: translateY(-50%);
    transition: width 0.3s ease;
}

@media (min-width: 769px) {
    .menu-link:hover {
        background: rgba(77, 97, 244, 0.1);
        color: #d7fe7c;
        padding-left: 2rem;
    }

    .menu-link:hover::before {
        width: 1rem;
    }

    [dir="rtl"] .menu-link:hover {
        padding-left: 1.5rem;
        padding-right: 2rem;
    }
}

[dir="rtl"] .menu-link::before {
    left: auto;
    right: 0;
}

.menu-link.active {
    background: rgba(77, 97, 244, 0.15);
    color: #d7fe7c;
}

/* Active tap state for mobile */
@media (hover: none) {
    .menu-link:active {
        background: rgba(77, 97, 244, 0.15);
        transform: scale(0.98);
    }
}

#navbar {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#navbar.scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ============================================
   FORM ELEMENTS - MOBILE OPTIMIZED
   ============================================ */
.input-field {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

/* Mobile input optimization */
@media (max-width: 768px) {
    .input-field {
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

.input-field:focus {
    outline: none;
    border-color: #4d61f4;
    box-shadow: 0 0 0 4px rgba(77, 97, 244, 0.1),
    0 10px 30px rgba(77, 97, 244, 0.2);
    background: rgba(10, 10, 10, 0.95);
}

@media (min-width: 769px) {
    .input-field:focus {
        transform: translateY(-2px);
    }
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

@media (min-width: 769px) {
    .input-field:hover {
        border-color: rgba(77, 97, 244, 0.5);
    }
}

/* ============================================
   FAQ ACCORDION - MOBILE OPTIMIZED
   ============================================ */
.faq-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-question {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile tap optimization */
@media (max-width: 768px) {
    .faq-question {
        padding: 1rem !important;
    }
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding-top: 0;
}

.faq-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    color: #4d61f4;
}

@media (min-width: 769px) {
    .faq-item:hover {
        transform: translateX(4px);
    }

    [dir="rtl"] .faq-item:hover {
        transform: translateX(-4px);
    }
}

/* ============================================
   CUSTOM SCROLLBAR - MOBILE OPTIMIZED
   ============================================ */
@media (min-width: 769px) {
    ::-webkit-scrollbar {
        width: 12px;
        height: 12px;
    }

    ::-webkit-scrollbar-track {
        background: #0a0a0a;
    }

    ::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #4d61f4, #d7fe7c);
        border-radius: 10px;
        border: 2px solid #0a0a0a;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, #6b7fff, #a0ff5c);
    }

    ::-webkit-scrollbar-corner {
        background: #0a0a0a;
    }

    * {
        scrollbar-width: thin;
        scrollbar-color: #4d61f4 #0a0a0a;
    }
}

/* Thin scrollbar on mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    ::-webkit-scrollbar-thumb {
        background: #4d61f4;
        border-radius: 4px;
    }
}

/* ============================================
   SELECTION
   ============================================ */
::selection {
    background: #d7fe7c;
    color: #0a0a0a;
}

::-moz-selection {
    background: #d7fe7c;
    color: #0a0a0a;
}

/* ============================================
   SMOOTH SCROLL
   ============================================ */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px;
    }
}

/* ============================================
   ANIMATIONS - MOBILE OPTIMIZED
   ============================================ */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(2deg);
    }
    66% {
        transform: translateY(-10px) rotate(-2deg);
    }
}

/* Reduce animation on mobile */
@media (max-width: 768px) {
    @keyframes float {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-10px);
        }
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(77, 97, 244, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(215, 254, 124, 0.5);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-shimmer {
    background: linear-gradient(
            90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* Disable heavy animations on mobile */
@media (max-width: 768px) {
    .animate-shimmer {
        animation: none;
    }
}

/* ============================================
   CARD EFFECTS - MOBILE OPTIMIZED
   ============================================ */
.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.card-hover::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(77, 97, 244, 0.1), rgba(215, 254, 124, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
}

@media (min-width: 769px) {
    .card-hover:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 20px 60px rgba(77, 97, 244, 0.3);
    }

    .card-hover:hover::before {
        opacity: 1;
    }
}

/* Mobile tap state */
@media (hover: none) {
    .card-hover:active {
        transform: scale(0.98);
    }
}

/* ============================================
   BUTTON EFFECTS - MOBILE OPTIMIZED
   ============================================ */
button, .btn {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:disabled, .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

button:active:not(:disabled), .btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* Larger tap targets on mobile */
@media (max-width: 768px) {
    button, .btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================
   NOTIFICATION - MOBILE OPTIMIZED
   ============================================ */
.notification {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 640px) {
    .notification {
        left: 1rem !important;
        right: 1rem !important;
        max-width: calc(100% - 2rem) !important;
    }
}

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

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
    background: linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ============================================
   MOBILE-SPECIFIC FIXES
   ============================================ */
@media (max-width: 768px) {
    /* Prevent text size adjustment on iOS */
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    /* Fix 100vh on mobile browsers */
    .min-h-screen {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    /* Better spacing on mobile */
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Reduce large headings on mobile */
    h1 {
        line-height: 1.2;
    }

    /* Optimize images */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    #navbar,
    #mobileMenu,
    #preloader,
    footer,
    button {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    body {
        background: white;
        color: black;
    }

    .gradient-text {
        -webkit-text-fill-color: black;
        background: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*:focus-visible {
    outline: 2px solid #4d61f4;
    outline-offset: 2px;
}

/* ============================================
   REDUCE MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   DARK MODE ENHANCEMENTS
   ============================================ */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0a0a0a;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    .glass {
        border-width: 2px;
        border-color: rgba(255, 255, 255, 0.5);
    }

    .gradient-text {
        -webkit-text-fill-color: #d7fe7c;
    }
}

/* ============================================
   SAFE AREA INSETS (iPhone X+)
   ============================================ */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    #navbar {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }
}

/* ============================================
   FLOATING BUTTONS ANIMATIONS
   ============================================ */
.portfolio-float {
    animation: float-gentle 3.5s ease-in-out infinite;
    animation-delay: 0.5s;
}

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

/* ============================================
   CLIENT LOGOS SWIPER - PREMIUM DESIGN
   ============================================ */

.client-logos-swiper-container {
    position: relative;
    overflow: hidden;
    padding: 2rem 0;
}

/* Swiper container styling */
.clientLogosSwiper {
    width: 100%;
    padding: 2rem 0;
    overflow: visible;
}

.clientLogosSwiper .swiper-wrapper {
    transition-timing-function: linear !important;
    align-items: center;
}

.clientLogosSwiper .swiper-slide {
    width: auto;
    height: auto;
}

/* Premium card design */
.client-logo-card {
    width: 220px;
    height: 140px;
    padding: 0.5rem;
}

.logo-card-inner {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1rem; /* REDUCED for more logo space */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animated gradient glow on hover */
.logo-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg,
    rgba(77, 97, 244, 0.3) 0%,
    rgba(215, 254, 124, 0.3) 50%,
    rgba(77, 97, 244, 0.3) 100%
    );
    border-radius: inherit;
    opacity: 0;
    filter: blur(20px);
    transition: opacity 0.5s ease;
    z-index: 0;
}

.logo-card-inner:hover {
    transform: translateY(-12px) scale(1.05);
    border-color: rgba(77, 97, 244, 0.4);
    background: rgba(255, 255, 255, 0.05);
    box-shadow:
            0 20px 60px rgba(77, 97, 244, 0.25),
            0 0 0 1px rgba(77, 97, 244, 0.3);
}

.logo-card-inner:hover .logo-glow {
    opacity: 1;
}

/* ENHANCED Smart logo sizing - perfect for any shape */
.logo-card-inner img {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    min-width: 80%; /* Force small logos to be bigger */
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.7;
    filter: brightness(1.15) saturate(0.8);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-card-inner:hover img {
    opacity: 1;
    filter: brightness(1) saturate(1);
    transform: scale(1.08);
}

/* Gradient fade edges */
.client-logos-swiper-container::before,
.client-logos-swiper-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    z-index: 10;
    pointer-events: none;
}

.client-logos-swiper-container::before {
    left: 0;
    background: linear-gradient(90deg,
    #0a0a0a 0%,
    rgba(10, 10, 10, 0.9) 30%,
    rgba(10, 10, 10, 0.5) 70%,
    transparent 100%
    );
}

.client-logos-swiper-container::after {
    right: 0;
    background: linear-gradient(270deg,
    #0a0a0a 0%,
    rgba(10, 10, 10, 0.9) 30%,
    rgba(10, 10, 10, 0.5) 70%,
    transparent 100%
    );
}

/* RTL Support */
html[dir="rtl"] .client-logos-swiper-container::before {
    left: auto;
    right: 0;
    background: linear-gradient(270deg,
    #0a0a0a 0%,
    rgba(10, 10, 10, 0.9) 30%,
    rgba(10, 10, 10, 0.5) 70%,
    transparent 100%
    );
}

html[dir="rtl"] .client-logos-swiper-container::after {
    right: auto;
    left: 0;
    background: linear-gradient(90deg,
    #0a0a0a 0%,
    rgba(10, 10, 10, 0.9) 30%,
    rgba(10, 10, 10, 0.5) 70%,
    transparent 100%
    );
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .client-logo-card {
        width: 200px;
        height: 130px;
    }

    .logo-card-inner {
        padding: 0.875rem;
        border-radius: 18px;
    }

    .logo-card-inner img {
        min-width: 75%;
    }

    .client-logos-swiper-container::before,
    .client-logos-swiper-container::after {
        width: 100px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .client-logos-swiper-container {
        padding: 1.5rem 0;
    }

    .clientLogosSwiper {
        padding: 1.5rem 0;
    }

    .client-logo-card {
        width: 170px;
        height: 110px;
    }

    .logo-card-inner {
        padding: 0.75rem;
        border-radius: 16px;
    }

    .logo-card-inner img {
        min-width: 70%;
    }

    .logo-card-inner:hover {
        transform: translateY(-8px) scale(1.03);
    }

    .client-logos-swiper-container::before,
    .client-logos-swiper-container::after {
        width: 60px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .client-logo-card {
        width: 150px;
        height: 100px;
    }

    .logo-card-inner {
        padding: 0.625rem;
        border-radius: 14px;
    }

    .logo-card-inner img {
        min-width: 65%;
    }

    .client-logos-swiper-container::before,
    .client-logos-swiper-container::after {
        width: 40px;
    }
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
    .clientLogosSwiper {
        animation: none !important;
    }

    .logo-card-inner,
    .logo-card-inner img,
    .logo-glow {
        transition: none !important;
    }
}