/* ===================================================================
   MAIN STYLESHEET - THE GRAND MERGE (المرحلة الأولى)
=================================================================== */

/* 1. Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 2. Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    /* تدرج لوني جديد يطابق ألوان الشعار بدقة */
    background: linear-gradient(135deg, #2196f3 0%, #21cbf3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 203, 243, 0.3);
    border-color: transparent; /* للتأكد من عدم وجود حدود غير مرغوبة */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.btn-outline {
    background: transparent;
    color: #2196F3;
    border-color: #2196F3;
}

.btn-outline:hover {
    background: #2196F3;
    color: white;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

/* 3. Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo-img {
    height: 50px;
    width: auto;
}

.nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-link:hover {
    color: #2196F3;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background: #2196F3;
    transition: width 0.3s ease;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.mobile-menu-toggle {
    display: none;
}

/* --- نهاية المرحلة الأولى --- */
/* --- استكمال المرحلة الأولى --- */

/* ===================================================================
   MAIN STYLESHEET - THE GRAND MERGE (المرحلة الثانية)
=================================================================== */

/* 4. Hero Section */
:root {
  --hero-blue: #2196F3;
  --hero-cyan: #21CBF3;
}

.hero {
  color: #fff;
  min-height: 100vh;
  padding: 120px 0 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 1;

  /* الخلفية الثابتة */
  background: radial-gradient(circle at center,
              var(--hero-cyan) 0%,
              var(--hero-blue) 100%);
}

/* طبقة "الظل" المتحركة */
.hero::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), transparent 60%);
  filter: blur(60px);
  animation: rotateShadow 10s linear infinite;
  z-index: 0;
}

/* حركة الدوران للظل */
@keyframes rotateShadow {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* النص */
.hero h1, .hero p {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}
.hero-description {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    opacity: 0.9;
}
.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.hero-image {
    text-align: center;
}
.hero-img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.2));
    animation: float 6s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}
/* Hero Button Overrides */
.hero .btn-primary {
    background: white;
    color: #2196F3;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.hero .btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-3px);
}
.hero .btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}
.hero .btn-outline:hover {
    background: white;
    color: #2196F3;
}

/* 5. Stats Container (Integrated into Hero) */
.stats-container {
    margin-top: 4rem;
    position: relative;
    z-index: 2;
}
.stats-card {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1rem 0;
}
.stat-item {
    text-align: center;
    min-width: 180px;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    display: block;
    margin-bottom: 0.25rem;
}
.stat-label {
    font-size: 1rem;
    opacity: 0.8;
    color: white;
}
.stat-icon {
    display: none;
}

/* 6. General Section Styles */
section {
    padding: 80px 0;
}
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #2196F3, #21CBF3);
    border-radius: 2px;
}
.section-description {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* --- نهاية المرحلة الثانية --- */
/* --- استكمال المرحلة الثانية --- */

/* ===================================================================
   MAIN STYLESHEET - THE GRAND MERGE (المرحلة الثالثة)
=================================================================== */

/* 7. Features Section (Grid Layout with Flip Effect) */
.features {
    background: #f8f9fa;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    /* أنماط لتفعيل تأثير القلب */
    perspective: 1000px;
    min-height: 280px;
}

.feature-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s;
    transform-style: preserve-3d;
}

.feature-card:hover .feature-card-inner {
    transform: rotateY(180deg);
}

.feature-card-front,
.feature-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.feature-card-back {
    background: linear-gradient(135deg, #2196F3, #21CBF3);
    color: white;
    transform: rotateY(180deg);
}

.feature-back-content h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.feature-back-content p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #2196F3, #21CBF3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.feature-description {
    color: #666;
    line-height: 1.6;
}

/* 8. Testimonials Section (Swiper Slider) */
.testimonials {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow: hidden;
}

.testimonials::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(33, 150, 243, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    z-index: 1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.testimonial-card {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 4rem;
    color: #2196F3;
    opacity: 0.3;
    font-family: serif;
}

.testimonial-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.testimonial-rating {
    display: flex;
    gap: 4px;
    margin-bottom: 1rem;
    justify-content: center;
}

.testimonial-rating .fas.fa-star {
    color: #ddd;
}

.testimonial-rating .fas.fa-star.active {
    color: #FFD700;
}

.testimonial-author {
    text-align: center;
}

.author-name {
    font-weight: 600;
    color: #2196F3;
    font-size: 1.1rem;
}

/* Swiper Custom Styles */
.testimonials-swiper {
    padding: 10px 10px 50px 10px;
    position: relative;
    z-index: 2;
}
.swiper-slide {
    height: auto;
}
.swiper-pagination-bullet-active {
    background-color: #2196F3 !important;
}
.swiper-button-next, .swiper-button-prev {
    color: #2196F3 !important;
}
.swiper-button-next.swiper-button-disabled, .swiper-button-prev.swiper-button-disabled {
    opacity: 0.35;
}

/* --- نهاية المرحلة الثالثة --- */
/* --- استكمال المرحلة الثالثة --- */

/* ===================================================================
   MAIN STYLESHEET - THE GRAND MERGE (المرحلة الرابعة)
=================================================================== */

/* 9. Courses Section */
.courses {
    background: #fff;
    position: relative;
}
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.course-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}
.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}
.course-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}
.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.course-card:hover .course-image img {
    transform: scale(1.1);
}
.course-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.course-card:hover .course-overlay {
    opacity: 1;
}
.course-stats {
    display: flex;
    gap: 1rem;
    color: white;
    font-size: 0.9rem;
}
.course-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.course-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.course-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}
.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}
.course-price {
    font-weight: 600;
    font-size: 1.1rem;
}
.price {
    color: #2196F3;
}
.price.free {
    color: #4CAF50;
}

/* 10. About Section */
.about {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}
.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
}
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}
.about .section-title {
    color: white;
    text-align: right;
}
.about .section-title::after {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    right: 0;
    transform: none;
}
.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}
.about-image {
    text-align: center;
}
.about-img {
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

/* 11. Contact Section */
.contact {
    background: #f8f9fa;
    position: relative;
}
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 2rem;
}
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}
.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2196F3, #21CBF3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.contact-details h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}
.contact-details p, .contact-details a {
    color: #666;
    margin: 0;
}
.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}
.whatsapp-btn:hover {
    background: #128C7E;
    transform: scale(1.05);
}
.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2196F3;
    background: white;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}
.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* --- نهاية المرحلة الرابعة --- */
/* --- استكمال المرحلة الرابعة --- */

/* ===================================================================
   MAIN STYLESHEET - THE GRAND MERGE (المرحلة الخامسة والأخيرة)
=================================================================== */

/* 12. Footer */
.footer {
    background: #1a1a1a;
    color: #ccc;
    padding: 3rem 0 1rem;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-logo-img {
    height: 40px;
    width: auto;
    margin-bottom: 1rem;
}
.footer-description {
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.social-links {
    display: flex;
    gap: 1rem;
}
.social-link {
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}
.social-link:hover {
    background: #2196F3;
    transform: translateY(-3px);
}
.footer-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: 0.5rem;
}
.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-links a:hover {
    color: #2196F3;
}
.footer-contact p {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    margin-bottom: 0.5rem;
}
.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 1rem;
    text-align: center;
    color: #999;
}

/* 13. Responsive Design */
@media (max-width: 992px) {
    .nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
    }
    .nav.is-active {
        display: flex;
        transform: translateX(0);
    }
    .nav-list {
        flex-direction: column;
        gap: 2rem;
    }
    .nav-link {
        font-size: 1.5rem;
    }
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        z-index: 1001;
    }
    .mobile-menu-toggle span {
        width: 25px;
        height: 3px;
        background: #333;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    .mobile-menu-toggle.is-active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .mobile-menu-toggle.is-active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.is-active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
}

@media (max-width: 768px) {
    .hero-content, .about-content, .contact-content,
    .courses-grid, .features-grid, .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .about .section-title::after {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
    
    /* ✨ إصلاح وتصغير الهيدر في الجوال ✨ */
    .header-content {
        height: 65px; /* ارتفاع مناسب للجوال */
    }
    .logo-img {
        height: 40px; /* تصغير الشعار */
    }
    .header .auth-buttons .btn {
        padding: 6px 14px; /* تصغير حجم الأزرار */
        font-size: 14px;   /* تصغير خط الأزرار */
    }
}
/* ===================================================================
   Animation Styles (أنماط الحركات الإضافية)
=================================================================== */

/* حركة ظهور العناصر عند التمرير */
.animate-ready {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-in {
    opacity: 1;
    transform: translateY(0);
}
 
/* ===================================================================
   Word Reveal Animation Styles (أنماط حركة ظهور الكلمات)
=================================================================== */

/* هذا يمنع اهتزاز التخطيط قبل بدء الحركة */
.section-title, .hero-title {
    min-height: 1.2em; 
}

/* نخفي الكلمات في البداية ونجهزها للحركة */
.word-reveal-container .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* عند ظهور الحاوية، نقوم بإظهار الكلمات بحركة ناعمة */
.word-reveal-container.is-visible .word {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================================================
   Final Color Correction (التصحيح النهائي للألوان)
=================================================================== */

/* 1. تعديل لون الأزرار الأساسية */
.btn-primary {
    background: linear-gradient(135deg, #2196F3, #26c6da); /* أزرق -> تركواز أخضر */
}

/* 2. تعديل لون أيقونات المميزات وخلفية البطاقة عند القلب */
.feature-icon, .feature-card-back {
    background: linear-gradient(135deg, #2196F3, #26c6da); /* أزرق -> تركواز أخضر */
}

/* 3. تعديل لون الخط تحت العناوين الرئيسية */
.section-title::after {
    background: linear-gradient(135deg, #2196F3, #26c6da); /* أزرق -> تركواز أخضر */
}

/* 4. تعديل لون أيقونات قسم "تواصل معنا" */
.contact-icon {
    background: linear-gradient(135deg, #2196F3, #26c6da); /* أزرق -> تركواز أخضر */
}
/* --- نهاية الملف --- */