/* ======================================================
   ClassMate - CSS for Year 2 Page (New Colors)
   ====================================================== */

/* --------- 1. Variables & Global Styles --------- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

:root {
    /* New color palette inspired by your code */
    --brand-blue: #0a2a43;
    --brand-blue-dark: #081f36;
    --accent-yellow: #ffcc00;
    --bg-light: #f9f9f9;
    --card-bg: #ffffff;
    --text-muted: #7a8ba6;
    --border-light: #e4e7eb;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    --radius: 12px;
    --transition: all 0.3s ease;
    --font-family: 'Cairo', sans-serif;

    /* Distinct colors for each term */
    --term3-color: var(--brand-blue); /* Main brand blue */
    --term4-color: #17a2b8;           /* A complementary Teal color */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--brand-blue-dark);
    line-height: 1.7;
    direction: rtl;
}

/* --------- 2. Header --------- */
.main-header {
    background-color: var(--card-bg);
    padding: 10px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .logo img {
    height: 150px;
    object-fit: contain;
}

.main-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--brand-blue);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}

.main-header .back-link:hover {
    background-color: var(--bg-light);
    color: var(--accent-yellow);
}

/* --------- 3. Main Content & Page Header --------- */
.main-content {
    padding: 40px 0;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--brand-blue-dark);
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* --------- 4. Department/Term Section --------- */
.department-section {
    margin-bottom: 50px;
}

.department-title {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    font-size: 1.8rem;
    padding: 12px 25px;
    border-radius: var(--radius) var(--radius) 0 0;
    color: #fff;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}
.department-title i {
    font-size: 1.6rem;
}

.term3-title { background-color: var(--term3-color); }
.term4-title { background-color: var(--term4-color); }

/* --------- 5. Academic Cards Grid --------- */
.academic-paths-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 30px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.term3-title + .academic-paths-grid { border-top: 4px solid var(--term3-color); }
.term4-title + .academic-paths-grid { border-top: 4px solid var(--term4-color); }

.academic-path-card {
    background-color: #fcfdff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-align: center;
    padding: 20px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.academic-path-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-yellow);
}

.card-icon-top {
    font-size: 2.2rem;
    margin-bottom: 12px;
    height: 40px;
    transition: var(--transition);
}

.term3-title ~ .academic-paths-grid .card-icon-top { color: var(--term3-color); }
.term4-title ~ .academic-paths-grid .card-icon-top { color: var(--term4-color); }

.academic-path-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--brand-blue-dark);
}

.academic-path-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    flex-grow: 1;
}

.academic-resources {
    list-style: none;
    padding: 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.academic-resources li a {
    display: block;
    text-decoration: none;
    font-weight: 600;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    background-color: var(--bg-light);
    color: var(--brand-blue);
}
.academic-resources li a:hover {
    background-color: var(--accent-yellow);
    color: var(--brand-blue-dark);
}

.academic-resources li a i {
    margin-left: 8px;
}

/* --------- 6. Footer --------- */
.site-footer {
    background-color: var(--brand-blue);
    color: #bdc3c7;
    padding: 50px 0 0;
    margin-top: 40px;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding-bottom: 30px;
}

.footer-logo img {
    max-height: 120px;
    margin-bottom: 15px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a {
    text-decoration: none;
    color: #bdc3c7;
    transition: var(--transition);
}

.footer-col ul a:hover {
    color: var(--accent-yellow);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--accent-yellow);
    color: var(--brand-blue-dark);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
}

.copyright-text {
    font-size: 0.9rem;
}

/* --------- 7. Responsive Design --------- */
@media (max-width: 768px) {
    .page-header h1 { font-size: 2rem; }
    .department-title { font-size: 1.5rem; }
    .academic-paths-grid { padding: 20px; }
}

@media (max-width: 480px) {
    .main-header { padding: 5px 3%; }
    .main-header .logo img { height: 120px; }
    .main-header .back-link { font-size: 0.9rem; padding: 6px 12px; }
    .footer-top { grid-template-columns: 1fr; text-align: center; }
    .social-links { justify-content: center; }
}
/* ==============================================
   ====== Media Query for Mobile Devices ======
   ============================================== */
@media (max-width: 768px) {
    /* --- Header Adjustments --- */
    .main-header {
        padding: 10px 15px; /* تقليل الحشو */
    }
    .logo img {
        height: 60px; /* تصغير اللوجو */
    }
    .back-link span {
        display: none; /* إخفاء نص "الرجوع للخلف" وترك الأيقونة فقط */
    }
    .back-link {
        font-size: 1.2rem; /* تكبير أيقونة السهم قليلاً */
    }

    /* --- Main Content Layout --- */
    .main-content {
        padding: 30px 15px; /* تقليل الحشو للمحتوى الرئيسي */
    }
    .page-header {
        margin-bottom: 40px;
    }
    .page-header h1 {
        font-size: 2.2rem; /* تصغير حجم العنوان الرئيسي */
    }
    .page-header p {
        font-size: 1.1rem; /* تصغير حجم النص التوضيحي */
    }

    /* --- Department Section --- */
    .department-title {
        font-size: 1.8rem; /* تصغير حجم عناوين الفصول الدراسية */
        padding-bottom: 10px;
        margin-bottom: 25px;
    }

    /* --- Academic Cards Grid --- */
    .academic-paths-grid {
        gap: 20px; /* تقليل المسافة بين الكروت */
    }
    .academic-path-card {
        padding: 20px; /* تقليل الحشو داخل الكارت */
    }
    .card-icon-top {
        font-size: 2.5rem; /* تصغير حجم الأيقونة العلوية */
    }
    .academic-path-card h4 {
        font-size: 1.3rem; /* تصغير حجم عنوان المادة */
    }
    .academic-resources a {
        padding: 12px; /* تكبير مساحة الضغط على الروابط */
    }

    /* --- Footer Adjustments --- */
    .footer-top {
        grid-template-columns: 1fr; /* جعل الأعمدة تحت بعضها */
        text-align: center; /* توسيط النصوص */
        gap: 40px;
    }
    .footer-about .footer-logo {
        margin: 0 auto 15px auto; /* توسيط اللوجو */
    }
    .footer-about p {
        margin: 0 auto; /* توسيط النص */
    }
    .social-links {
        justify-content: center; /* توسيط أيقونات التواصل الاجتماعي */
    }
    .social-links a {
        margin: 0 5px;
    }
}