/* -------------------- I. تعريف الخطوط المخصصة (@font-face) -------------------- */
@font-face {
    font-family: 'Expo-Bold';
    src: url('./fonts/Expo-Arabic-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap; 
}

@font-face {
    font-family: 'Al-Jazeera-Regular';
    src: url('./fonts/Al-Jazeera-Arabic-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* -------------------- II. الإعدادات الأساسية -------------------- */
:root {
    --primary-color: #0066ff;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --transition-speed: 0.3s;
}

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

/* تطبيق خط Al-Jazeera-Regular على جميع النصوص */
body {
    font-family: 'Al-Jazeera-Regular', 'Arial', sans-serif; 
    background: linear-gradient(135deg, #2a2a72 0%, #009ffd 74%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden; /* تم تغييرها في .auth-body */
    direction: rtl; 
}

/* تنسيق الـ Container للصفحات التي تحتوي على الشريط الجانبي */
.container {
    display: flex;
    width: 90%;
    height: 85vh;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
    direction: rtl; 
}

/* -------------------- الشريط الجانبي (Sidebar) -------------------- */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    padding: 30px 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.08); 
    border-right: none; 
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) ease;
    position: relative;
}

.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo i {
    font-size: 36px;
    color: #fff;
    opacity: 0.9;
}

/* تطبيق خط Expo-Bold على عنوان اللوجو */
.logo h2 {
    font-family: 'Expo-Bold', sans-serif; 
    font-size: 20px;
    font-weight: 700; 
    margin-top: 5px;
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    margin-bottom: 8px;
    border-radius: 16px;
    transition: all 0.2s ease;
    position: relative;
}

.menu li:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu li.active {
    background: rgba(255, 255, 255, 0.25);
}

.menu li.active::before {
    content: '';
    position: absolute;
    right: -15px; 
    left: auto; 
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 4px 0 0 4px; 
}

.menu a {
    display: flex;
    align-items: center;
    color: #fff;
    padding: 12px 16px;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.menu a i {
    font-size: 20px;
    margin-left: 14px; 
    margin-right: 0; 
    min-width: 22px;
    text-align: center;
}

.profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    margin-left: 12px;
    margin-right: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
}

.user-info p {
    font-size: 12px;
    opacity: 0.8;
}

/* -------------------- المحتوى الرئيسي (Content) -------------------- */
.content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

header {
    margin-bottom: 30px;
}

/* تطبيق خط Expo-Bold على العناوين الكبيرة */
header h1 {
    font-family: 'Expo-Bold', sans-serif; 
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

header p {
    font-size: 16px;
    opacity: 0.8;
}

/* -------------------- المشاريع والبطاقات (Project Cards) -------------------- */

/* تطبيق خط Expo-Bold على العناوين المتوسطة */
.featured-projects h2, .request-form-section h2 {
    font-family: 'Expo-Bold', sans-serif; 
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-top: 15px; 
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 24px;
    margin-top: 30px;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block; 
    text-align: right; 
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 15px;
}

/* تطبيق خط Expo-Bold على عناوين المشاريع داخل البطاقة */
.project-card .card-info h3 {
    font-family: 'Expo-Bold', sans-serif; 
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.project-card .card-info p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.view-btn {
    display: inline-block;
    padding: 8px 15px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.view-btn:hover {
    background: #004ecc;
}

/* -------------------- نموذج طلب المشروع (Request Form) -------------------- */
.request-form-section {
    margin-top: 40px;
}

.request-form {
    padding: 30px;
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    opacity: 0.9;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 16px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group select option {
    background-color: #1a1a40; 
    color: #fff;
}

/* تطبيق خط Expo-Bold على زر الإرسال */
.submit-btn {
    font-family: 'Expo-Bold', sans-serif; 
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
}

.submit-btn:hover {
    background: #004ecc;
}

.submit-btn:active {
    transform: scale(0.99);
}

/* -------------------- تنسيق صفحات المصادقة (Login/Signup) -------------------- */
.auth-body {
    background: linear-gradient(135deg, #2a2a72 0%, #009ffd 74%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow-y: auto; 
    overflow-x: hidden;
    direction: rtl; 
}

.auth-card {
    width: 400px;
    max-width: 90%;
    padding: 40px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: right;
}

.auth-card h2 {
    font-family: 'Expo-Bold', sans-serif; 
    margin-bottom: 25px;
    font-size: 28px;
    text-align: center;
}

.auth-card a {
    text-decoration: none;
}

/* -------------------- تعديلات متجاوبة (Responsive) -------------------- */

@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .menu a span {
        display: none;
    }
    
    .menu a i {
        margin-left: 0; 
    }
    
    .user-info {
        display: none;
    }
    
    .profile {
        justify-content: center;
    }
    
    .avatar {
        margin-left: 0;
        margin-right: 0;
    }
    
    .content {
        padding: 30px;
    }
    
    .card-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        height: 90vh;
    }
    
    .sidebar {
        width: 60px; 
    }
    
    .card-container {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 25px;
    }
}

/* -------------------- مؤثر الظهور السلس (Reveal on Scroll CSS) -------------------- */

.hidden-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out; 
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}
