/* ============================================
   تصميم محسن وحيوي - Enhanced Design
   ============================================ */

/* تطبيق الخلفية المتحركة على الجسم */
body {
    position: relative;
    overflow-x: hidden;
}

/* تحسين البطاقات */
.grade-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.grade-card:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 20px 40px rgba(30, 95, 116, 0.2);
}

/* تحسين الأزرار */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

/* تحسين شريط التنقل */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* تأثيرات على الروابط */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: all 0.3s;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* تحسين قسم Hero */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(77, 171, 245, 0.15) 0%, transparent 70%);
    animation: float-slow 20s ease-in-out infinite;
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(44, 158, 124, 0.12) 0%, transparent 70%);
    animation: float-slow 25s ease-in-out infinite reverse;
    pointer-events: none;
}

@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, -30px) rotate(10deg); }
}

/* تحسين بطاقات الإحصائيات */
.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-number {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* تحسين بطاقات المميزات */
.feature-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    animation: icon-bounce 2s ease-in-out infinite;
}

@keyframes icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* تحسين قسم المعلمة */
.teacher-section {
    position: relative;
    overflow: hidden;
}

.teacher-section::before {
    content: '';
    position: absolute;
    top: 10%;
    right: 5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(243, 156, 18, 0.1) 0%, transparent 70%);
    animation: pulse-glow 4s ease-in-out infinite;
}

.teacher-image {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.teacher-image:hover {
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

/* تحسين قسم CTA */
.cta-box {
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: rotate-slow 30s linear infinite;
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* تحسين التذييل */
.footer {
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    background-size: 300% 100%;
    animation: gradient-move 5s linear infinite;
}

@keyframes gradient-move {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.social-links a {
    transition: all 0.3s;
}

.social-links a:hover {
    transform: translateY(-5px) rotate(360deg);
}

/* تحسينات للجوال */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .stat-card {
        padding: var(--space-lg);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .feature-card {
        padding: var(--space-xl);
    }
    
    .teacher-profile {
        gap: var(--space-lg);
    }
    
    .teacher-image {
        width: 180px;
        height: 180px;
    }
    
    .cta-box h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.5rem;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
    
    .grade-card {
        padding: var(--space-md);
    }
    
    .grade-icon {
        font-size: 2rem;
    }
    
    .grade-number {
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }
    
    .feature-title {
        font-size: 1.25rem;
    }
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 1400px) {
    .container {
        max-width: 1300px;
    }
    
    .hero-text h1 {
        font-size: 4rem;
    }
    
    .stat-number {
        font-size: 3rem;
    }
}

/* تحسينات للتابلت */
@media (min-width: 769px) and (max-width: 1024px) {
    .grades-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* تحسين أداء الرسوم المتحركة على الجوال */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* تحسين للشاشات العريضة جداً */
@media (min-width: 1920px) {
    .container {
        max-width: 1500px;
    }
}

/* تأثيرات إضافية للتفاعل */
.interactive-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-hover:hover {
    transform: translateY(-3px) scale(1.02);
}

/* تأثير الظل الديناميكي */
.dynamic-shadow {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.dynamic-shadow:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* تحسين القراءة */
.improved-text {
    line-height: 1.8;
    letter-spacing: 0.3px;
}

/* تحسين التباين */
.high-contrast {
    color: #1a1a1a;
}

/* تأثيرات الظهور عند التمرير */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
