/* ========================================
   GLOBAL VARIABLES & ANIMATIONS
   ======================================== */

/* استيراد الخطوط المحلية فقط */


:root {
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-fast: all 0.2s ease-in-out;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ========================================
   HERO SECTION EFFECTS
   ======================================== */

#hero-section {
    position: relative;
    transition: var(--transition-smooth);
}

/* Hero background animation */
.hero-bg-animate {
    animation: heroFloat 20s ease-in-out infinite;
    transition: var(--transition-smooth);
}

@keyframes heroFloat {
    0%, 100% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(1.05) translateY(-10px);
    }
}

#hero-section:hover .hero-bg-animate {
    opacity: 0.35 !important;
}

/* Button hover effects */
.btn-hover-scale {
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    z-index: 1;
}

.btn-hover-scale::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.btn-hover-scale:hover::before {
    width: 300px;
    height: 300px;
}

.btn-hover-scale:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.btn-hover-scale:active {
    transform: translateY(-1px) scale(1.02);
}

/* Stats cards counter animation */
.counter-animate {
    transition: var(--transition-smooth);
    display: inline-block;
}

.card-hover:hover .counter-animate {
    transform: scale(1.2);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.card-hover {
    transition: var(--transition-smooth);
    cursor: pointer;
}

.card-hover:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

/* ========================================
   FEATURES SECTION EFFECTS
   ======================================== */

#features-section .card-hover-lift {
    transition: var(--transition-smooth);
    position: relative;
}

#features-section .card-hover-lift::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--bs-primary), var(--bs-blue));
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#features-section .card-hover-lift:hover::after {
    width: 100%;
}

#features-section .card-hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

/* Icon bounce effect */
.icon-bounce {
    transition: var(--transition-bounce);
    display: inline-flex;
}

#features-section .card-hover-lift:hover .icon-bounce {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(-5deg);
    }
    50% {
        transform: translateY(-5px) rotate(5deg);
    }
    75% {
        transform: translateY(-7px) rotate(-3deg);
    }
}

/* Icon scale on hover */
#features-section .card-hover-lift:hover .icon-bounce i {
    transform: scale(1.1);
}

/* ========================================
   CATEGORIES SECTION EFFECTS
   ======================================== */

#categories-section .card-hover-lift {
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

/* Image zoom container */
.img-zoom-container {
    overflow: hidden;
    position: relative;
}

.img-zoom {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

#categories-section .card-hover-lift:hover .img-zoom {
    transform: scale(1.15) rotate(2deg);
}

/* Overlay gradient effect */
#categories-section .card-hover-lift::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(5, 35, 65, 0.1) 0%,
        rgba(59, 130, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

#categories-section .card-hover-lift:hover::before {
    opacity: 1;
}

#categories-section .card-hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

/* Card body lift effect */
#categories-section .card-hover-lift:hover .card-body {
    transform: translateY(-3px);
    transition: var(--transition-smooth);
}

/* ========================================
   COURSES SECTION EFFECTS
   ======================================== */

#courses-section .card-hover-lift {
    transition: var(--transition-smooth);
    position: relative;
}

#courses-section .card-hover-lift::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0.375rem;
    box-shadow: 0 0 0 0 rgba(5, 35, 65, 0.4);
    transition: box-shadow 0.4s ease;
    pointer-events: none;
}

#courses-section .card-hover-lift:hover::after {
    box-shadow: 0 0 0 4px rgba(5, 35, 65, 0.2);
}

#courses-section .card-hover-lift:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-xl);
}

#courses-section .card-hover-lift:hover .img-zoom {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Badge pulse animation */
.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
}

/* Link hover effect */
.link-hover {
    position: relative;
    transition: var(--transition-fast);
}

.link-hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--bs-primary);
    transition: width 0.3s ease;
}

.link-hover:hover::after {
    width: 100%;
}

.link-hover:hover {
    color: var(--bs-primary) !important;
    transform: translateX(3px);
}

/* Stars rating hover */
#courses-section .card-hover-lift:hover .bi-star-fill,
#courses-section .card-hover-lift:hover .bi-star-half {
    animation: starTwinkle 0.5s ease;
}

@keyframes starTwinkle {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ========================================
   INSTRUCTORS SECTION EFFECTS
   ======================================== */

#instructors-section .card-hover-lift {
    transition: var(--transition-smooth);
    position: relative;
}

#instructors-section .card-hover-lift::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
        var(--bs-primary),
        var(--bs-info),
        var(--bs-success),
        var(--bs-warning));
    border-radius: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

#instructors-section .card-hover-lift:hover::before {
    opacity: 1;
}

#instructors-section .card-hover-lift:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: var(--shadow-xl);
}

/* Image hover scale */
.img-hover-scale {
    transition: var(--transition-smooth);
}

#instructors-section .card-hover-lift:hover .img-hover-scale {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ========================================
   CALL TO ACTION SECTION EFFECTS
   ======================================== */

#call-to-action-section {
    position: relative;
    overflow: hidden;
}

/* Animated particles background */
.cta-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cta-particles::before,
.cta-particles::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: particleFloat 15s ease-in-out infinite;
}

.cta-particles::before {
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.cta-particles::after {
    bottom: -100px;
    right: -100px;
    animation-delay: 7s;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

/* ========================================
   GLOBAL UTILITY EFFECTS
   ======================================== */

/* Smooth all transitions */
a, button, .card, .btn {
    transition: var(--transition-smooth);
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 3px solid rgba(5, 35, 65, 0.5);
    outline-offset: 3px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Hover glow effect for primary buttons */
.btn-primary:hover {
    box-shadow: 0 0 20px rgba(5, 35, 65, 0.5);
}

/* Badge hover effects */
.badge {
    transition: var(--transition-fast);
}

.badge:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Smooth image loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Performance optimizations */
.card-hover-lift,
.btn-hover-scale,
.img-zoom {
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
}

/* ========================================
   RESPONSIVE TOUCH DEVICES
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Disable complex hover effects on touch devices */
    .card-hover-lift:hover,
    .btn-hover-scale:hover {
        transform: none;
    }

    /* Keep simple feedback */
    .card-hover-lift:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}
