/* --- 1. المتغيرات الأساسية (الوضع الداكن هو الافتراضي) --- */
:root {
    /* Dark Mode Variables */
    --main-color: #00bcd4;
    --secondary-color: #008c9e;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-white: #ffffff;
    --text-muted: #94a3b8;
    --transition: all 0.3s ease-in-out;

    /* Light Mode Defaults */
    --light-bg: #f8f9fa;
    --light-text: #111827;
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-white: #111827;
    --text-muted: #6b7280;
    --main-color: #00bcd4;
    --secondary-color: #008c9e;
}

/* --- 2. الإعدادات العامة --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-white);
    overflow-x: hidden;
    scroll-behavior: smooth;
    direction: rtl;
    transition: var(--transition);
}

/* ===== Background Canvas ===== */
    #timeline-bg { 
     position:fixed;
     top:0; left:0; 
     width:100%; 
     height:100%;
     z-index:-1;
     }


header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: var(--transition);
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn {
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-login {
    border: 2px solid var(--main-color);
    color: var(--main-color);
    background: transparent;
}

.btn-login:hover {
    background: var(--main-color);
    color: white;
    transform: translateY(-3px);
}

.btn-register {
    background: var(--main-color);
    color: white;
}

.btn-register:hover {
    background: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.4);
    transform: translateY(-3px);
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--main-color);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .btn {
        padding: 8px 16px;
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 12px 5%;
    }

    .btn {
        padding: 7px 14px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    .nav-buttons {
        gap: 6px;
    }
    /* لاحقًا يمكن استبدال الأزرار بهامبورجر menu */
}


/* --- 4. Hero Section (البوستر والعنوان) --- */
.hero {
    margin-top: 100px; /* مسافة تحت الهيدر */
    width: 100%;
    padding: 20px 5%;
    display: flex;
    flex-direction: column;
    align-items: center; /* لتوسيط العنوان والبوستر في المنتصف تماماً */
}

/* ستايل "منصة الباحث" المستوحى من صورتك */
.main-platform-title {
    text-align: center;
    /* حجم خط مرن: يصغر تلقائياً في الموبايل ويكبر في الشاشات الكبيرة */
    font-size: clamp(38px, 8vw, 85px); 
    font-weight: 900; /* وزن عريض جداً ليماثل الصورة */
    color: var(--main-color); /* اللون التركواز الأساسي */
    margin-bottom: 25px;
    font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; /* فونت عريض */
    letter-spacing: -2px; /* تقريب الحروف لبعضها كما في الصورة */
    text-shadow: 0 5px 15px rgba(0, 188, 212, 0.3); /* توهج بسيط يتناسب مع الوضع الداكن */
    line-height: 1.1;
}

.poster-container {
    width: 100%;
    max-width: 1200px; /* أقصى عرض للبوستر للحفاظ على جودته في الشاشات الكبيرة */
    border-radius: 25px; /* حواف دائرية */
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

/* تعديل الظل في الوضع الفاتح */
body.light-mode .poster-container, 
[data-theme="light"] .poster-container {
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.poster-container img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* --- التجاوب مع شاشات الموبايل --- */
@media (max-width: 768px) {
    .hero {
        margin-top: 80px; /* تقليل المسافة العلوية في الموبايل */
        padding: 10px 4%;
    }

    .main-platform-title {
        margin-bottom: 15px;
        letter-spacing: -1px; /* تقليل التباعد ليناسب الشاشات الصغيرة */
    }
}

/* --- 5. About Section (من هو المستر) --- */
.about {
    padding: 100px 5%;
    background-color: var(--bg-primary);
    overflow: hidden;
    transition: var(--transition);
    padding: 80px 5%;
    background: rgba(15,23,42,0.6);
}

.about-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.about-img {
    flex: 1;
    min-width: 300px;
    max-width: 450px;
}

.img-frame {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.img-frame img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.img-frame:hover img {
    transform: scale(1.05);
}

.about-content {
    flex: 1.5;
    min-width: 300px;
}

.about-title {
    font-size: 38px;
    font-weight: 800;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
    color: var(--main-color);
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.about-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 70px;
    height: 4px;
    background: var(--main-color);
    border-radius: 2px;
}

.reveal-text {
    font-size: 22px;
    font-family: 'Gill Sans', sans-serif;
    line-height: 1.8;
    color: var(--text-muted);
    font-weight: 900 bold;
    text-align: justify;
}

.word {
    display: inline-block;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-left: 6px;
}

.word.visible {
    opacity: 1;
    transform: translateY(0);
}

.about-stats {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    justify-content: space-around;
    text-align: center;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #334155;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.stat-card i {
    color: var(--main-color);
    margin-bottom: 10px;
}

.stat-card .count {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-white);
}

/* --- Responsive Media Queries --- */
@media (max-width: 1024px) {
    .about-wrapper {
        gap: 40px;
    }
    .about-title {
        font-size: 32px;
    }
    .reveal-text {
        font-size: 20px;
    }
    .stat-card .count {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .about-wrapper {
        flex-direction: column;
        gap: 30px;
    }
    .about-title {
        font-size: 28px;
        text-align: center;
    }
    .reveal-text {
        font-size: 18px;
        text-align: center;
    }
    .about-img, .about-content {
        max-width: 100%;
    }
    .about-stats {
        flex-direction: column;
        gap: 20px;
    }
    .stat-card .count {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .about {
        padding: 60px 3%;
    }
    .about-title {
        font-size: 24px;
    }
    .reveal-text {
        font-size: 16px;
    }
    .stat-card .count {
        font-size: 20px;
    }
    .about-stats {
        gap: 15px;
    }
}


/* --- 6. Why Us Section (المميزات) --- */
.features-section {
    padding: 80px 5%;
    background-color: var(--bg-primary);
    text-align: center;
    transition: var(--transition);
}

.section-header {
    margin-bottom: 50px;
}

.section-header h2 {
    text-align: center;
    font-size: 46px;
    font-weight: 900;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: var(--text-white);
    margin-bottom: 60px;
    position: relative;
    cursor: pointer;
    transition: color 0.3s ease;
}

.section-header h2::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #00bcd4, #0097a7);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.main-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.sub-title {
    color: var(--text-muted);
    font-size: 16px;
}

.cta-section {
  background: linear-gradient(90deg, var(--main-color), var(--secondary-color));
  color: #fff;
  padding: 60px 5%;
  text-align: center;
  border-radius: 20px;
  margin: 50px auto;
  max-width: 1200px;
}

.cta-btn {
  font-size: 18px;
  padding: 15px 30px;
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}



/*features*/
.features-section{
     padding: 80px 5%;
    background: rgba(15,23,42,0.6);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-secondary);
    padding: 40px 20px;
    border-radius: 20px;
    border: 1px solid #334155;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--main-color);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.icon-box {
    font-size: 45px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 22px;
    color: var(--text-white);
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 15px;
}

/* ===== Courses Section ===== */
.courses {
    padding: 80px 5%;
    background: rgba(15,23,42,0.6);
}


.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.course-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transition: var(--transition);
    border: 1px solid #334155;
}

.course-card:hover {
    transform: translateY(-10px);
    border-color: var(--main-color);
}

.course-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.course-content {
    padding: 25px;
    text-align: center;
}

.course-content h3 {
    font-size: 22px;
    color: var(--text-white);
    margin-bottom: 10px;
}

.course-content p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.course-btn {
    display: inline-block;
    background: var(--main-color);
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
}

.course-btn:hover {
    background: var(--secondary-color);
}

.course-price {
    display: block;
    margin-top: 15px;
    font-size: 20px;
    font-weight: bold;
    color: var(--main-color);
}




/* --- 8. Academic Years (الصفوف الدراسية) --- */
.years {
    padding: 80px 5%;
    background: var(--bg-primary);
    transition: var(--transition);
}

.years-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.year-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    height: 300px;
    width: 100%;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.year-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.year-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 188, 212, 0.9), transparent);
    color: white;
    text-align: center;
}
.year-overlay h3{
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}

.section-title {
    text-align: center;
    font-size: 46px;
    font-weight: 900;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: var(--text-white);
    margin-bottom: 60px;
    position: relative;
    cursor: pointer;
    transition: color 0.3s ease;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #00bcd4, #0097a7);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.section-title:hover {
    color: var(--main-color);
}

.section-title:hover::after {
    width: 140px;
}


/*الاراء*/
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}

.testimonial-card {
  background: var(--bg-secondary);
  padding: 25px;
  border-radius: 20px;
  border: 1px solid #334155;
  text-align: center;
  transition: var(--transition);
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.testimonial-card .avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 2px solid var(--main-color);
}


/* --- أيقونة الواتساب العائمة --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px; /* يسار الشاشة عشان متبقاش فوق زرار السهم للأعلى */
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #25d366, #128c7e); /* ألوان واتساب أصلية */
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3), 0 0 20px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    text-decoration: none;
    transition: var(--transition);
    animation: floatAnim 3s ease-in-out infinite; /* حركة الصعود والهبوط */
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* حركة الطلوع والنزول */
@keyframes floatAnim {
    0% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0); }
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(10deg);
    background: #075e54;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

/* نص ترحيبي يظهر بجانب الأيقونة */
.tooltip-text {
    position: absolute;
    right: 70px;
    background: var(--bg-secondary); /* متناسق مع الثيم الداكن */
    color: var(--main-color);
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    border: 1px solid var(--main-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.whatsapp-float:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
    right: 80px;
}

/* موبايل */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 25px;
        bottom: 20px;
        left: 20px;
    }
    .tooltip-text { display: none; } /* إخفاء النص في الموبايل */
}

/*scroll button*/
/* Scroll Buttons */
.scroll-buttons {
    position: fixed;
    bottom: 30px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}

.scroll-buttons button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--main-color), var(--secondary-color));
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 188, 212, 0.35);
    transition: all 0.35s ease;
    opacity: 0;
    transform: translateY(20px);
}

/* Hover Animation */
.scroll-buttons button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 188, 212, 0.6);
}

/* Show Buttons */
.scroll-buttons.show button {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile size */
@media (max-width: 768px) {
    .scroll-buttons {
        left: 15px;
        bottom: 20px;
    }

    .scroll-buttons button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}


/* --- 9. Footer (الفوتر) --- */
footer {
    background: var(--bg-primary);
    color: var(--text-white);
    padding: 50px 5% 20px;
    text-align: center;
    transition: var(--transition);
}
footer p {
    color: gold;
    font-weight: bold;
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
}

.social-links a {
    color: var(--text-white);
    font-size: 26px;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--main-color);
    transform: translateY(-5px);
}

/* --- 10. Media Queries (التجاوب مع الشاشات) --- */
@media (max-width: 1024px) {
    .features-grid, .years-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .about-wrapper {
        flex-direction: column;
        text-align: center;
    }
    .features-grid, .years-container {
        grid-template-columns: 1fr;
    }
    .about-title::after {
        right: 50%;
        transform: translateX(50%);
    }
    .nav-buttons span {
        display: none;
    }
}

/* --- سكشن السنوات الدراسية --- */
.academic-years {
    text-align: center;
     padding: 80px 5%;
    background: rgba(15,23,42,0.6);
}

.section-title {
    color: var(--text-white);
    font-size: 2.5rem;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 3px;
    background: var(--main-color);
    bottom: -10px;
    left: 20%;
    border-radius: 5px;
}

.years-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.year-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 188, 212, 0.1);
    transition: var(--transition);
    position: relative;
}

/* هوفر على الكارد بالكامل */
.year-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 15px 40px rgba(0, 188, 212, 0.2);
    border-color: var(--main-color);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.year-card:hover .card-image img {
    transform: scale(1.1); /* زووم خفيف للصورة عند الهوفر */
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--bg-secondary));
}

.card-content {
    padding: 25px;
}

.card-content h3 {
    color: var(--main-color);
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.card-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.btn-card {
    display: inline-block;
    padding: 10px 25px;
    background: transparent;
    border: 2px solid var(--main-color);
    color: var(--main-color);
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
}

.btn-card:hover {
    background: var(--main-color);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 188, 212, 0.4);
}

/* تخصيص للموبايل */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
}