/**
 * Portfolio Stylesheet
 * 1. Global & Base
 * 2. Animations
 * 3. Layout Components (Nav, Footer)
 * 4. UI Elements (Cards, Buttons, Inputs)
 * 5. Utilities & Effects
 */

/* --- 1. Global & Base --- */
[x-cloak] { display: none !important; }
@font-face { font-family: 'Kufam'; src: url('assets/fonts/Kufam.ttf') format('truetype'); font-weight: 400 900; font-display: swap; unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200F; }
/* Kufam للعربي فقط — الحروف اللاتينية بتنزل لـ Segoe UI/Arial (حرف V في Kufam شبه U) */
.font-ar { font-family: 'Kufam', 'Segoe UI', Arial, sans-serif; }
.font-en { font-family: 'Space Grotesk', sans-serif; }

html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: hidden; }

section { scroll-margin-top: 100px; }
@media (max-width: 768px) { section { scroll-margin-top: 80px; } }

/* Reduce reflows */
img { max-width: 100%; height: auto; }

/* --- 2. Animations --- */
@keyframes gradientBG {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes floatPremium {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

@keyframes loaderBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-20px); }
}

.animate-gradient { animation: gradientBG 15s ease infinite; }
.animate-float-premium { animation: floatPremium 6s ease-in-out infinite; }

/* --- 3. Layout Components --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, #8F00FF, #3EF8C2);
    z-index: 100;
    transition: width 0.1s ease-out;
}

nav.scrolled {
    padding: 0.6rem 1.5rem !important;
    margin-top: 0.5rem;
    width: 95%;
    left: 2.5%;
    border-radius: 1.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.8) !important;
}

@media (min-width: 1024px) {
    nav.scrolled {
        width: 80%;
        left: 10%;
        padding: 0.8rem 2.5rem !important;
        margin-top: 1rem;
        border-radius: 2rem;
    }
}

.dark nav.scrolled { background: rgba(13, 27, 42, 0.8) !important; }

/* --- 4. UI Elements --- */
.card-blur {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(13, 27, 42, 0.08);
    will-change: transform;
}

.dark .card-blur {
    background: rgba(13, 27, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hover-lift:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 60px -12px rgba(143, 0, 255, 0.25);
    border-color: rgba(143, 0, 255, 0.3);
}

.active-click:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Custom Nav Link Underline Effect */
.nav-link-custom {
    position: relative;
    padding-bottom: 2px;
    display: inline-block;
}

.nav-link-custom::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #8F00FF;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.nav-link-custom:hover::after,
.nav-link-custom.active::after {
    width: 100% !important;
}

/* --- 5. Utilities & Effects --- */
.bg-gradient-brand {
    background-image: linear-gradient(-45deg, #8F00FF, #3EF8C2, #0D1B2A, #8F00FF);
    background-size: 400% 400%;
}

.nav-link-custom.active {
    color: #3EF8C2 !important;
    opacity: 1 !important;
}

.nav-link-custom.active::after {
    background-color: #3EF8C2 !important;
}

.dark .nav-link-custom:hover:not(.active)::after {
    background-color: #8F00FF;
}

/* --- 6. Accessibility --- */
:focus-visible { outline: 2px solid #3EF8C2; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
