/* ========================================= */
/*      Modern University Design System      */
/*      Theme: Professional, Academic, Tech  */
/* ========================================= */

:root {
    /* Color Palette */
    --primary-color: #0a2342;
    /* Deep Royal Blue */
    --primary-light: #1e3a5c;
    /* Lighter Blue for hover */
    --secondary-color: #f8f9fa;
    /* Off-white Background */
    --accent-color: #FFD700;
    /* Luminous Gold */
    --accent-dark: #b8860b;
    /* Dark Gold */

    --text-primary: #1a1a1a;
    /* Nearly Black */
    --text-secondary: #555555;
    /* Grey Text */
    --text-light: #ffffff;
    /* White Text */

    --success-color: #28a745;
    --error-color: #dc3545;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0a2342 0%, #1e3a5c 100%);
    --gradient-gold: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    --gradient-overlay: linear-gradient(rgba(10, 35, 66, 0.85), rgba(10, 35, 66, 0.7));

    /* Shadows & Glassmorphism */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.18);

    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);

    /* Spacing & Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================= */
/*      Reset & Base Styles                  */
/* ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    color: var(--text-primary);
    background-color: #f0f2f5;
    line-height: 1.8;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

/* ========================================= */
/*      Header & Navigation                  */
/* ========================================= */

header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 55px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

header h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.menu-toggle {
    display: none;
    /* Hidden on Desktop */
}

/* Nav Overlay default */
.nav-overlay {
    display: none;
}

nav ul {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    transition: var(--transition-smooth);
    border-radius: 2px;
}

nav a:hover::after,
nav a:active::after {
    width: 100%;
}

/* Mobile Dropdown Logic */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
    overflow: hidden;
    padding: 0.5rem 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding-right: 1.8rem;
}

/* ========================================= */
/*      Hero Section                         */
/* ========================================= */

.hero {
    position: relative;
    padding: 8rem 2rem;
    text-align: center;
    background: var(--gradient-overlay), url('images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-light);
    margin: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: background-image 1s ease-in-out;
}

.hero-content h2 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.4rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background: var(--gradient-gold);
    color: var(--primary-color);
    font-weight: 800;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transition: var(--transition-smooth);
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* ========================================= */
/*      Features Section                     */
/* ========================================= */

.features {
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    background: rgba(255, 215, 0, 0.1);
    padding: 1rem;
    border-radius: 50%;
}

.feature-card h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================= */
/*      Info Section (News/Announcements)    */
/* ========================================= */

.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto 4rem;
    padding: 0 2rem;
}

.info-box {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border-top: 5px solid var(--accent-color);
}

.info-box h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.info-box ul li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

.info-box ul li:last-child {
    border: none;
}

.info-box ul li a {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.info-box ul li a::before {
    content: '•';
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.5rem;
    margin-left: 0.8rem;
    line-height: 0;
}

.info-box ul li a:hover {
    color: var(--primary-light);
    transform: translateX(-5px);
}


/* ========================================= */
/*      Inner Pages Content                  */
/* ========================================= */

main.inner-page {
    padding: 3rem 2rem;
}

.page-content {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page-content h2 {
    color: var(--primary-color);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.page-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-gold);
    border-radius: 2px;
}

/* ========================================= */
/*      Forms & Inputs                       */
/* ========================================= */

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: #f9fafb;
    transition: var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(10, 35, 66, 0.1);
}

/* ========================================= */
/*      Tables                               */
/* ========================================= */

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 1.2rem;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

tr:hover {
    background-color: #f8fafc;
}


/* ========================================= */
/*      Footer                               */
/* ========================================= */

footer {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-section h4 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    transition: 0.2s;
}

.footer-section a:hover {
    color: var(--accent-color);
    padding-right: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.social-links a:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================= */
/*      Mobile Responsiveness                */
/* ========================================= */

@media (max-width: 768px) {

    /* Header improvements */
    /* Header improvements */
    header {
        flex-direction: row;
        /* Keep row for Logo + Toggle */
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .header-content {
        max-width: 80%;
    }

    .logo {
        height: 40px;
    }

    header h1 {
        font-size: 0.9rem;
        text-align: right;
        display: none;
        /* Hide long text on mobile if needed, or keep small */
    }

    /* Show H1 but smaller */
    @media (min-width: 350px) {
        header h1 {
            display: block;
        }
    }

    /* Mobile Menu Toggle */
    .menu-toggle {
        display: block;
        font-size: 1.8rem;
        color: var(--primary-color);
        cursor: pointer;
        z-index: 1002;
        /* Above nav info */
    }

    /* Navigation Drawer */
    nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: #fff;
        z-index: 1001;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        padding-top: 4rem;
        /* Space for close button */
        overflow-y: auto;
    }

    nav.nav-active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 0;
        padding: 0;
    }

    nav a {
        display: block;
        padding: 1rem 1.5rem;
        text-align: right;
        background: transparent;
        border-radius: 0;
        color: var(--primary-color);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        font-size: 1rem;
    }

    nav a:hover {
        background: var(--secondary-color);
        padding-right: 1.8rem;
    }

    /* Dropdown improvements for Drawer */
    .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: #f8f9fa;
        margin-top: 0;
        display: none;
    }

    .dropdown.active .dropdown-content {
        display: block;
        animation: none;
        /* Remove slideDown animation for smoother expand */
    }

    .dropdown-content a {
        padding: 0.8rem 2.5rem 0.8rem 1.5rem;
        /* More indentation */
        font-size: 0.9rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    }

    /* Overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Hero section improvements */
    .hero {
        padding: 4rem 1.5rem;
        margin: 1rem;
    }

    .hero-content h2 {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        padding: 1rem 2rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    /* Features section improvements */
    .features {
        padding: 3rem 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature-card {
        padding: 2rem 1.5rem;
    }

    /* Info section improvements */
    .info-section {
        grid-template-columns: 1fr;
        padding: 0 1rem;
        gap: 1.5rem;
    }

    .info-box {
        padding: 1.5rem;
    }

    .info-box h3 {
        font-size: 1.3rem;
    }

    /* Page content improvements */
    .page-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .page-content h2 {
        font-size: 1.6rem;
    }

    /* Table improvements */
    .table-responsive {
        margin: 0 -1rem;
        border-radius: 0;
    }

    th,
    td {
        padding: 0.8rem 0.5rem;
        font-size: 0.85rem;
    }

    /* Form improvements */
    .form-group {
        margin-bottom: 1.2rem;
    }

    label {
        font-size: 0.9rem;
    }

    input,
    select,
    textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 0.9rem 1rem;
    }

    /* Footer improvements */
    footer {
        padding: 3rem 1.5rem 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    /* College cards improvements */
    .colleges-grid {
        grid-template-columns: 1fr;
    }

    .college-card {
        margin: 0 1rem;
    }

    /* Study plans improvements */
    .study-plans-filter {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .semesters-grid {
        grid-template-columns: 1fr;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .page-content {
        padding: 1.5rem 1rem;
    }

    th,
    td {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* ==================================== */
/*   Legacy Override for Inner Pages    */
/* ==================================== */

/* Colleges Page Cards */
.colleges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.college-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.college-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--secondary-color);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dean-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--accent-color);
    box-shadow: var(--shadow-sm);
}

.card-details {
    padding: 1.5rem;
}

.details-btn {
    width: 100%;
    padding: 0.8rem;
    margin-top: 1rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
}

.details-btn:hover {
    background: var(--primary-light);
}

/* Deanships */
.deanships-page .deanship-column {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    transition: var(--transition-smooth);
}

.deanships-page .deanship-column:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Admission */
.admission-list li {
    background: #f0f7ff;
    margin-bottom: 0.8rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--primary-color);
}

.admission-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--success-color);
}

/* Study Plans Filter */
.study-plans-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid #e9ecef;
}

.study-plans-filter .form-group {
    margin-bottom: 0;
}

/* Creative Study Plan Design */
.plan-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.plan-header h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.plan-stats {
    display: inline-flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    background: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
}

.semesters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.semester-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
    animation: slideUpFade 0.5s ease backwards;
}

.semester-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.semester-header {
    background: var(--primary-color);
    color: #fff;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.semester-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.semester-header i {
    opacity: 0.7;
    font-size: 1.2rem;
}

.courses-list {
    padding: 1rem 0;
}

.course-item {
    padding: 0.8rem 1.5rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.course-item:last-child {
    border-bottom: none;
}

.course-item:hover {
    background: #f8f9fa;
}

.course-info {
    display: flex;
    flex-direction: column;
}

.course-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.course-hours {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.course-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
    margin-right: 1rem;
}

.badge-university {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.badge-college {
    background: #e8f5e9;
    color: #388e3c;
    border: 1px solid #c8e6c9;
}

.badge-specialty {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffe0b2;
}

.badge-default {
    background: #f5f5f5;
    color: #616161;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================= */
/*            Organizational Chart           */
/* ========================================= */
.tree {
    display: flex;
    justify-content: center;
    direction: ltr;
    /* Force LTR for correct line drawing, content stays RTL via local overrides if needed */
}

.tree ul {
    padding-top: 20px;
    position: relative;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
    -moz-transition: all 0.5s;
    display: flex;
    justify-content: center;
    padding-left: 0;
}

.tree li {
    float: left;
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 5px 0 5px;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
    -moz-transition: all 0.5s;
}

/* Connectors */
.tree li::before,
.tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid #ccc;
    width: 50%;
    height: 20px;
}

.tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid #ccc;
}

/* Remove connectors from single child */
.tree li:only-child::after,
.tree li:only-child::before {
    display: none;
}

.tree li:only-child {
    padding-top: 0;
}

/* Remove left/right connectors from first/last child */
.tree li:first-child::before,
.tree li:last-child::after {
    border: 0 none;
}

/* Add back vertical connector for last child */
.tree li:last-child::before {
    border-right: 2px solid #ccc;
    border-radius: 0 5px 0 0;
    -webkit-border-radius: 0 5px 0 0;
    -moz-border-radius: 0 5px 0 0;
}

.tree li:first-child::after {
    border-radius: 5px 0 0 0;
    -webkit-border-radius: 5px 0 0 0;
    -moz-border-radius: 5px 0 0 0;
}

/* Downward connector from parent */
.tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid #ccc;
    width: 0;
    height: 20px;
}

/* The Card Styling */
.tree-card {
    border: 1px solid #ddd;
    padding: 15px;
    text-decoration: none;
    color: #666;
    font-family: 'Tajawal', sans-serif;
    display: inline-block;
    border-radius: 5px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
    -moz-transition: all 0.5s;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    direction: rtl;
    /* Reset direction for content */
    position: relative;
    z-index: 10;
}

.tree-card img {
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    margin-bottom: 10px;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.tree-card:hover,
.tree-card:hover+ul li .tree-card {
    border: 1px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.tree-card:hover img {
    border-color: var(--primary-color);
}

.tree-card h4 {
    font-size: 1rem;
    margin: 0.5rem 0;
    color: var(--primary-color);
}

.tree-card p {
    font-size: 0.85rem;
    color: #777;
    margin: 0;
}

/* Responsiveness: Stack on mobile */
@media (max-width: 900px) {
    .tree {
        direction: rtl;
        display: block;
        overflow-x: auto;
    }

    .tree ul {
        display: flex;
        /* Keep flex to allow scrolling if needed, or block for stacking */
        /* For true mobile diagram, simplified stacking is better */
        flex-direction: column;
        align-items: center;
        padding-right: 0;
    }

    .tree li {
        float: none;
        text-align: center;
        padding: 10px 0;
    }

    /* Hide lines on mobile for simplicity */
    .tree li::before,
    .tree li::after,
    .tree ul ul::before {
        display: none;
    }

    /* Add simple downward arrow instead */
    .tree li:not(:last-child)::after {
        content: '\\f107';
        /* FontAwesome angle-down */
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        display: block;
        margin: 5px auto;
        color: #ccc;
    }
}


.text-center {
    text-align: center !important;
}

/* Input Icon Wrapper */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1.2rem;
    color: #9ca3af;
    /* text-muted substitute if var not defined, but var(--text-muted) was used in file */
    pointer-events: none;
    z-index: 10;
}

.input-icon-wrapper input:not([type="tel"]),
.input-icon-wrapper select {
    padding-right: 3rem;
}

/* Fix for Intl Tel Input */
.iti {
    width: 100%;
    direction: ltr;
}

.iti input {
    width: 100%;
    padding: 0.9rem 1.2rem !important;
    padding-left: 90px !important;
    /* Space for flag + code */
    border: 1px solid #d1d5db;
    border-radius: 8px;
    /* Assuming radius-sm is around 8px */
    font-family: inherit;
    font-size: 1rem;
    background: #f9fafb;
    transition: all 0.3s ease;
    text-align: left;
}

.iti input:focus {
    border-color: #0a2342;
    /* primary-color */
    background: #fff;
    box-shadow: 0 0 0 4px rgba(10, 35, 66, 0.1);
    outline: none;
}

/* ========================================= */
/*      University in Numbers Section        */
/* ========================================= */

.university-stats {
    padding: 4rem 2rem;
    background-color: var(--secondary-color);
    text-align: center;
}

.stats-header {
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.stats-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.stats-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    /* Gold underline */
    margin: 10px auto 0;
    border-radius: 2px;
}

.stats-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    width: 300px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.stat-card .icon-box {
    width: 80px;
    height: 80px;
    background-color: var(--primary-color);
    /* Blue background */
    color: var(--accent-color);
    /* Gold Icon */
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(10, 35, 66, 0.3);
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    display: flex;
    align-items: center;
    justify-content: center;
    direction: ltr;
    /* Ensure consistent Number+ ordering */
    margin-bottom: 0.5rem;
    gap: 0.2rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    /* Blue Text */
    line-height: 1;
    font-family: 'Tajawal', sans-serif;
}

.stat-plus {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    /* Gold Plus */
    line-height: 1;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .stats-grid {
        flex-direction: column;
        align-items: center;
    }

    .stat-card {
        width: 100%;
        max-width: 350px;
    }
}