/* إعدادات المتغيرات للوضع الليلي والنهاري */
:root {
    --bg-color: #fefcff;
    --text-color: #474d3f;
    --panel-bg: #ffffff;
    --nav-bg: #474d3f;
    --card-bg: #ffffff;
    --footer-bg: #474d3f;
    --secondary-text: #5a6250;
}

.dark {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --panel-bg: #1e293b;
    --nav-bg: #020617;
    --card-bg: #1e293b;
    --footer-bg: #020617;
    --secondary-text: #94a3b8;
}

/* Sidebar Dark Mode Fixes */
.dark #main-sidebar {
    background-color: var(--nav-bg);
}
.dark #main-sidebar a {
    color: #94a3b8 !important;
}
.dark #main-sidebar a:hover {
    background-color: rgba(255,255,255,0.05) !important;
}
.dark #main-sidebar a.bg-blue-50, 
.dark #main-sidebar a.bg-emerald-50,
.dark #main-sidebar a.bg-orange-50 {
    background-color: rgba(255,255,255,0.1) !important;
    color: white !important;
}

/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

/* --- تنسيق القائمة العلوية --- */
.navbar {
    background-color: var(--nav-bg); 
    padding: 0 50px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: 90px; /* ارتفاع مناسب */
    display: flex;
    align-items: center;
}

.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%; /* زيادة المساحة قليلاً */
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px; /* إضافة هوامش لإبعاد العناصر عن الأطراف */
}

/* تنسيق الشعار */
.logo img {
    height: 110px; /* حجم متناسق وأنيق */
    width: auto;
    margin-top: 5px; /* رفعه قليلاً للأعلى */
    /* فلتر لتفتيح الشعار وإزالة الخلفية الرمادية */
    filter: brightness(1.2) contrast(1.2); 
    transition: 0.3s;
}

/* روابط القائمة */
.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-right: 30px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    transition: 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: #fad755; /* اللون الأصفر للموقع */
}

/* --- قسم الهيرو وعرض الصور المتحرك --- */
.hero-section {
    position: relative;
    width: 100%;
    height: 130vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slideshow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: slideAnimation 15s infinite linear;
    background-position: center top;
}

/* تتابع الصور */
.slide1 { animation-delay: 0s; }
.slide2 { animation-delay: 5s; }
.slide3 { animation-delay: 10s; }

@keyframes slideAnimation {
    0%   { opacity: 0; }
    5%   { opacity: 1; }
    33%  { opacity: 1; }
    38%  { opacity: 0; }
    100% { opacity: 0; }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* تغشية غامقة للصور */
    z-index: 2;
}

/* --- تنسيق النصوص في النص --- */
.hero-text {
    position: relative;
    z-index: 3;
    text-align: center;
    margin-top: 100px; /* إنزال الكلمة للأسفل */
    
}

.hero-text h1 {
    font-size: 90px;
    font-weight: 900;
    color: #fad755;
    text-shadow: 2px 4px 15px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
    margin-bottom: 10px;
}

.hero-text p {
    font-size: 33px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.5);
}
/* تنسيق زر تسجيل الدخول */
.login-btn {
    display: inline-block;
    margin-top: 25px;       /* مسافة تفصله عن الجملة التي فوقه */
    padding: 10px 30px;
    background-color: #fad755; /* لون أصفر مثل كلمة مدرسة ينقل */
    color: #000;            /* لون الخط أسود ليكون واضحاً */
    text-decoration: none;  /* إزالة الخط السفلي أو النقاط */
    font-size: 22px;
    font-weight: bold;
    border-radius: 8px;     /* حواف منحنية قليلاً */
    transition: 0.3s;       /* نعومة عند تمرير الماوس */
    cursor: pointer;
}

/* تأثير عند تمرير الماوس */
.login-btn:hover {
    background-color: #fff; /* يتغير للأبيض عند اللمس */
    transform: translateY(-3px); /* حركة بسيطة للأعلى */
}
/* --- تنسيق قسم عن المدرسة --- */
.about-section {
    padding: 80px 0;
    background-color: var(--panel-bg); /* خلفية متغيرة */
    display: flex;
    justify-content: center;
}

.about-container {
    display: flex;
    max-width: 1200px;
    width: 90%;
    align-items: center;
    gap: 50px; /* مسافة بين النص والصورة */
}

/* محتوى النص */
.about-content {
    flex: 1;
    text-align: right;
}

.about-content h2 {
    font-size: 45px;
    color: var(--text-color); 
    margin-bottom: 10px;
    font-weight: 900;
}

/* الخط الصغير تحت العنوان */
.divider {
    width: 60px;
    height: 4px;
    background-color: #fad755; /* لون المدرسة الأصفر */
    margin-bottom: 30px;
    border-radius: 2px;
}

.about-content p {
    font-size: 24px;
    line-height: 1.8;
    color: var(--secondary-text);
    margin-bottom: 20px;
}

/* تنسيق الصورة */
.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    border-radius: 15px; /* حواف دائرية مثل الصورة */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); /* ظل خفيف */
}

/* لجعل القسم متجاوب مع الهواتف */
@media (max-width: 768px) {
    .about-container {
        flex-direction: column-reverse; /* الصورة فوق والنص تحت في الموبايل */
        text-align: center;
    }
    .about-content {
        text-align: center;
    }
    .divider {
        margin: 0 auto 30px;
    }
    /* تحسين القسم الرئيسي في الموبايل ليطابق القياس المطلوب */
    .hero-section {
        height: 80vh; /* تقليل الارتفاع الإجمالي ليظهر بالكامل */
    }
    .hero-text {
        margin-top: 50px; /* تقليل المسافة العلوية للنصوص */
        padding: 0 15px; /* هوامش جانبية لمنع ملامسة الحواف */
    }
    .hero-text h1 {
        font-size: 32px;
        margin-bottom: 5px;
    }
    .hero-text p {
        font-size: 16px;
    }
    .login-btn {
        font-size: 14px;
        padding: 8px 20px;
        margin-top: 15px;
        border-radius: 6px;
    }
    /* تحسين صفحة التسجيل في الموبايل */
    .register-body {
        padding: 20px 10px 10px 10px; /* تقليل الحواف الخارجية خاصة من الأسفل */
        min-height: auto; /* إلغاء الارتفاع الكامل للسماح بتقلص الصفحة */
    }
    .register-container {
        padding: 35px 25px; /* نفس حشوة نموذج تسجيل الدخول */
        border-radius: 30px;
        max-width: 450px; /* نفس عرض نموذج تسجيل الدخول */
        width: 90%;
        margin: 20px auto;
        aspect-ratio: auto; /* إزالة الشكل المربع والعودة للمستطيل المتناسق */
        display: block;
    }
    .register-header img {
        height: 80px; /* تصغير اللوجو أكثر */
        margin-bottom: 12px;
    }
    .register-header h2 {
        font-size: 19px;
    }
    .register-header p {
        font-size: 12px;
    }
    .form-group {
        margin-bottom: 15px; /* تقليل المسافات بين الحقول */
    }
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    .form-group input, .form-group select {
        padding: 12px 15px; /* تصغير حشوة الحقول */
        font-size: 14px;
    }
    .submit-btn {
        padding: 12px;
        font-size: 16px;
    }
    .registration-closed-container h3 {
        font-size: 19px;
    }
    .registration-closed-container .w-24 {
        width: 50px;
        height: 50px;
        font-size: 25px;
    }
}/* --- تنسيق قسم برامج المدرسة --- */
.programs-section {
    padding: 60px 20px;
    background-color: var(--bg-color); 
    text-align: center;
}

.section-title {
    font-size: 35px;
    font-weight: 900;
    color: #444;
    margin-bottom: 40px;
}

.programs-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 40px;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .programs-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* تصميم البطاقة الواحدة */
.program-card {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
}

.program-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

/* صورة البطاقة */
.program-image {
    width: 100%;
    height: 250px;
}

.program-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.program-card:hover .program-image img {
    transform: scale(1.1);
}

/* نص البطاقة */
.program-info {
    padding: 40px 30px;
    text-align: center;
    flex-grow: 1;
}

.program-info h3 {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 20px;
    font-weight: 900;
    line-height: 1.4;
    min-height: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.program-info p {
    font-size: 19px;
    line-height: 1.8;
    color: var(--secondary-text);
    font-weight: 500;
}

.footer-section {
    background-color: var(--footer-bg); 
    color: white;
    padding: 60px 20px 20px;
    direction: rtl; 
}


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

/* --- تنسيق الجزء العلوي (Header) --- */
.footer-header {
    display: flex;
    justify-content: space-between; /* توزيع العناصر على الأطراف */
    align-items: center; /* توسيط عمودي */
    margin-bottom: 30px; /* مسافة قبل الخط */
}

/* الشعار */
.footer-logo img {
    height: 180px; /* حجم الشعار في الأسفل أكبر ليكون واضحاً */
    width: auto;
    filter: brightness(1.2); /* تفتيح الشعار قليلاً */
}

/* أيقونات التواصل */
.footer-social-links {
    display: flex;
    gap: 15px; /* مسافة بين الأيقونات */
}

.social-icon {
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.1); /* خلفية بيضاء شفافة */
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%; /* دائرية */
    text-decoration: none;
    font-weight: bold;
    font-size: 20px;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
/* تنسيق أيقونة يوتيوب عند التمرير */
.social-icon.youtube:hover {
    background-color: #FF0000; /* لون يوتيوب الأحمر */
    color: white;
    border-color: #FF0000;
}

/* تنسيق أيقونة انستجرام عند التمرير */
.social-icon.instagram:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); /* ألوان انستجرام التدريجية */
    color: white;
    border-color: transparent;
}

/* تنسيق أيقونة إكس عند التمرير */
.social-icon.x-twitter:hover {
    background-color: #000; /* لون إكس الأسود */
    color: white;
    border-color: #333;
}

/* تكبير الأيقونة قليلاً داخل الدائرة */
.social-icon i {
    font-size: 22px;
}
.social-icon:hover {
    background-color: #fad755; /* اللون الأصفر عند التمرير */
    color: black;
    transform: translateY(-5px); /* حركة بسيطة للأعلى */
}

/* الخط الفاصل */
.footer-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* خط أبيض شفاف جداً */
    margin: 0 auto 50px; /* مسافة قبل الأقسام السفلية */
    width: 100%;
}

/* --- تنسيق الجزء السفلي (Main) --- */
.footer-main {
    display: flex;
    justify-content: space-between; /* توزيع متساوي للأعمدة */
    gap: 40px; /* مسافة بين الأعمدة */
    margin-bottom: 40px;
}

/* تنسيق عام للأعمدة */
.footer-col {
    flex: 1; /* تأخذ مساحة مرنة بالتساوي */
    text-align: right; /* محاذاة لليمين */
}

/* عناوين الأعمدة مع الخط الأصفر */
.footer-col h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0; /* يبدأ من اليمين */
    width: 50px;
    height: 3px;
    background-color: #fad755; /* اللون الأصفر */
    border-radius: 5px;
}

/* تنسيق عمود "منارة لتحفيظ القرآن" */
.about-col p {
    font-size: 17px;
    line-height: 1.8;
    color: #ccc;
}

/* تنسيق عمود القوائم (وسط) */
.links-col ul {
    list-style: none;
}

.links-col li {
    margin-bottom: 15px;
}

.links-col a {
    color: #ccc;
    text-decoration: none;
    font-size: 18px;
    font-weight: 400;
    transition: 0.3s;
}

.links-col a:hover {
    color: #fad755; /* يتحول للأصفر عند التمرير */
    padding-right: 5px; /* حركة بسيطة لليسار */
}

/* تنسيق عمود التواصل (يسار) */
.contact-item {
    font-size: 18px;
    color: #ccc;
    margin-bottom: 2px; /* لتقريب الأسطر عمودياً */
    display: flex;
    justify-content: flex-start; /* تقريب الرقم من النص جهة اليمين */
    gap: 10px; /* المسافة بين الرقم والكلمة */
    align-items: center;
    width: 100%;
    max-width: 100%; /* للسماح للإيميل بالبقاء في سطر واحد */
    white-space: nowrap; /* يمنع انقسام الإيميل لسطرين */
    margin-right: auto;
}


.contact-label {
    color: white;
    font-weight: bold;
    font-size: 16px;
    order: 1; /* التعريف يمين */
}

.contact-item span:first-child {
    font-weight: normal;
    font-size: 20px;
    color: #fad755; /* الأرقام باللون الأصفر */
    order: 2; /* الأرقام يسار */
}

/* شريط حقوق النشر */
.footer-bottom-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #888;
}

/* التجاوب مع الهواتف - تحسين التذييل */
@media (max-width: 900px) {
    .footer-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-main {
        flex-direction: column; /* الأعمدة تحت بعضها في الشاشات الصغيرة */
        text-align: center !important;
        gap: 40px;
    }
    
    .footer-col {
        text-align: center !important;
    }

    .footer-col h3::after {
        right: 50% !important;
        transform: translateX(50%) !important;
    }

    .contact-item {
        justify-content: center !important;
        flex-direction: row-reverse;
        gap: 15px;
        margin-bottom: 10px;
        white-space: normal; /* السماح بالتفاف النص إذا لزم الأمر */
    }

    .contact-label {
        font-size: 14px;
    }

    .contact-item span:first-child {
        font-size: 18px;
    }

    .footer-social-links {
        justify-content: center;
        width: 100%;
    }
}
html {
    scroll-behavior: smooth !important;
}
/* --- تنسيق صفحة التسجيل --- */
.register-body {
    background: radial-gradient(circle at center, #474d3f, #2a2e26); /* زيتوني ملكي داكن جداً وصلب */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 60px 20px;
}

.register-container {
    background: linear-gradient(145deg, #474d3f, #3d4236); /* زيتوني ملكي أكثر كثافة وصلابة */
    width: 100%;
    max-width: 650px;
    padding: 60px 50px;
    border-radius: 40px;
    box-shadow: 0 50px 120px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.register-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #fad755, #f2cc4b);
}

.register-header {
    text-align: center;
    margin-bottom: 30px;
}

.register-header img {
    height: 160px; /* تكبير الشعار قليلاً */
    width: auto;
    margin: 0 auto 30px auto;
    display: block;
    filter: drop-shadow(0px 4px 10px rgba(0,0,0,0.3)); /* ظل لتوضيح الشعار */
    transition: transform 0.5s ease;
}

.register-header h2 {
    color: #fad755; /* ذهبي مشرق */
    font-weight: 900;
    font-size: 34px;
    letter-spacing: -0.5px;
}

.register-header p {
    color: #e2e8f0; /* نص أفتح وأكثر وضوحاً */
    font-size: 17px;
    font-weight: 500;
    margin-top: 15px;
    opacity: 0.9;
}

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

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 12px;
    color: #f8fafc; /* أبيض ناصع للوضوح التام */
    font-size: 16px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 16px 20px;
    background-color: rgba(255, 255, 255, 0.04); /* شفافية عالية لتأثير زجاجي */
    border: 1px solid rgba(250, 215, 85, 0.15); /* حدود ذهبية شفافة */
    border-radius: 16px;
    color: #ffffff;
    font-family: 'Cairo';
    font-size: 17px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input:focus, .form-group select:focus {
    border-color: #fad755;
    background-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.2);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group select option {
    background-color: #1e293b;
    color: white;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background-color: #fad755;
    color: #1a2e24; /* خط غامق للوضوح */
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.submit-btn:hover {
    background-color: #e6b800;
    transform: translateY(-2px);
}

.back-home {
    position: absolute;
    top: 20px;
    right: 20px;
}

.back-home a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 25px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.back-home a:hover {
    background: #fad755;
    color: #1a2e24;
    border-color: #fad755;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 204, 0, 0.2);
}

/* تخصيص لصفحة التسجيل (لتبقى زرقاء كما كانت إذا لزم الأمر، أو يمكن توحيدها) */
.register-body .back-home a {
    color: #474d3f;
    background: #fad755;
    border: 2px solid #474d3f;
}

.register-body .back-home a:hover {
    background: #474d3f;
    color: #fad755;
}

.file-upload-wrapper small {
    display: block;
    margin-top: 8px;
    color: rgba(250, 215, 85, 0.85); /* ذهبي هادئ بدلاً من الأبيض الصارخ */
    font-weight: 700;
    font-size: 13px;
}
/* تمييز الحقل الإجباري عند الخطأ */
.file-upload-wrapper input[type="file"].is-invalid {
    border-color: #ff4d4d;
}

/* إضافة رمز النجمة الحمراء بجانب العنوان لبيان أنه إجباري */
.form-group label::after {
    content: " *";
    color: red;
}

.form-group label[for="email"]::after,
.form-group label[for="personal-phone"]::after {
    content: "";
}
/* تنسيق إخفاء وإظهار التسجيل */
.registration-closed-msg {
    display: none; /* مخفية دائماً في الحالة العادية */
}

/* عندما نضيف كلمة closed للفورم، يحدث التالي: */
.register-form.closed {
    display: none !important; /* إخفاء الاستمارة فوراً */
}

.register-form.closed ~ .registration-closed-msg {
    display: block !important; /* إظهار رسالة الاعتذار فوراً */
}

/* --- تنسيق صفحة تسجيل الدخول --- */
.login-body {
    background: linear-gradient(135deg, rgba(71, 77, 63, 0.6), rgba(71, 77, 63, 0.8)), url('/images/login-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.login-container {
    background: linear-gradient(145deg, #474d3f, #5a6250); /* زيتوني ملكي فخم ليتناسب مع الشعار */
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 480px;
    padding: 35px 30px; /* Reduced padding slightly to fit better */
    border-radius: 30px; /* حواف أكثر نعومة */
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 20px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-header img {
    height: 120px;
    width: auto;
    margin: 0 auto 15px auto;
    display: block;
    filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.1));
}

.login-header h2 {
    color: #fad755; /* ذهبي */
    font-weight: 900;
    font-size: 28px;
    margin-bottom: 8px;
}

.login-header p {
    color: #ddd;
    font-size: 15px;
}

.login-form .form-group label {
    color: #eee;
}

.login-header p {
    color: #888;
    font-size: 15px;
}

/* حقل الإدخال مع الأيقونة */
.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%; /* تأكد من أن الحاوية تأخذ العرض الكامل للحقل */
}

.input-icon {
    position: absolute;
    right: 15px;
    color: #bbb;
    font-size: 16px;
    transition: 0.3s;
    z-index: 2;
}

.input-icon-wrapper input {
    padding-right: 45px !important;
    padding-left: 45px !important; /* مساحة لزر إظهار كلمة المرور */
}

.input-icon-wrapper input:focus + .input-icon,
.input-icon-wrapper input:focus ~ .input-icon {
    color: #fad755;
}

.password-toggle {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #bbb;
    cursor: pointer;
    z-index: 10;
    padding: 5px;
    transition: 0.3s;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #fad755;
}

/* تجاوز النجمة الحمراء في صفحة الدخول */
.login-form .form-group label::after {
    content: "";
}

/* خيارات تسجيل الدخول */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #666;
    font-weight: 600;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #fad755;
    cursor: pointer;
}

.forgot-password {
    color: #fad755;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}

.forgot-password:hover {
    color: #e6b800;
    text-decoration: underline;
}

/* رابط التسجيل أسفل الزر */
.login-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 15px;
    color: #888;
}

.login-footer-link a {
    color: #fad755;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}

.login-footer-link a:hover {
    color: #e6b800;
    text-decoration: underline;
}

/* تجاوب صفحة الدخول مع الهواتف */
@media (max-width: 500px) {
    .login-container {
        padding: 30px 20px;
        margin: 10px;
    }
    .login-header img {
        height: 90px;
    }
    .login-header h2 {
        font-size: 22px;
    }
}

/* --- تنسيق رسائل التنبيه --- */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeInUp 0.4s ease-out;
}

.alert i {
    font-size: 20px;
    margin-top: 2px;
}

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

.alert ul li {
    margin-bottom: 5px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-success i {
    color: #28a745;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-error i {
    color: #dc3545;
}

/* تحسين مظهر النوافذ المنبثقة لمنع خروجها عن الشاشة */
[x-show] .bg-white.rounded-2xl {
    max-height: 90vh;
    overflow-y: auto;
}

/* Custom scrollbar for modals */
/* Custom scrollbar for modals */
[x-show] .bg-white.rounded-2xl::-webkit-scrollbar {
    width: 6px;
}
[x-show] .bg-white.rounded-2xl::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* --- تحسينات التجاوب الشاملة (Responsive Overrides) --- */

/* 1. الجداول المتجاوبة */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 1rem;
}

.table-responsive table {
    min-width: 600px; /* لضمان عدم ضغط البيانات بشكل كبير */
}

/* 2. تحسين القائمة الجانبية (دائماً مخفية وتظهر عند الضغط) */
.sidebar-container, #main-sidebar {
    position: fixed;
    right: -100%; /* مخفية افتراضياً في كل الشاشات */
    top: 0;
    bottom: 0;
    z-index: 2000;
    width: 280px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

#main-sidebar.translate-x-0 {
    right: 0 !important;
    transform: translateX(0) !important;
}

#main-sidebar.translate-x-full {
    right: -300px !important;
    transform: translateX(100%) !important;
}

/* الستارة الخلفية */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 1999;
}

.main-content, main {
    width: 100% !important;
    padding: 1rem !important;
    padding-top: 80px !important;
    transition: all 0.3s ease;
}

@media (min-width: 1024px) {
    .main-content, main {
        padding: 2.5rem !important;
        padding-top: 100px !important;
    }
}

/* 3. زر القائمة - يظهر دائماً الآن */
.mobile-toggle, .desktop-toggle {
    display: flex;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 2001;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #1a1b25;
    cursor: pointer;
    border: none;
    transition: 0.3s;
}

.mobile-toggle:hover {
    transform: scale(1.1);
    color: #1e3a8a;
}

/* 4. تحسين شبكة البطاقات (Stats Cards) */
.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

/* 5. تحسين الصفحة الرئيسية (Home Page) في الجوال */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 45px;
    }
    
    .hero-text p {
        font-size: 20px;
    }
    
    .navbar .container {
        padding: 0 15px;
    }
    
    .nav-links {
        display: none; /* سنحتاج لإضافة منيو جوال للهوم لاحقاً */
    }

    .about-section {
        padding: 40px 15px;
    }

    .about-container {
        gap: 20px;
    }

    .section-title {
        font-size: 28px;
    }
}

/* 6. تحسين النوافذ المنبثقة (Modals) */
@media (max-width: 640px) {
    [x-show] .bg-white.rounded-2xl,
    [x-show] .bg-white.rounded-\[2rem\],
    [x-show] .bg-white.rounded-\[2\.5rem\],
    [x-show] .bg-white.rounded-\[3rem\] {
        width: 95vw !important;
        max-width: none !important;
        margin: 5px !important;
        padding: 15px !important;
    }
}

/* 7. أدوات المساعدة */
.hidden-mobile {
    @media (max-width: 768px) {
        display: none !important;
    }
}

.full-width-mobile {
    @media (max-width: 768px) {
        width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* 8. نظام تداول الجداول في الموبايل */
.table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-responsive table {
    min-width: 750px !important; /* ضمان وجود مساحة كافية للتمرير في شاشات الجوال */
}

@media (min-width: 1024px) {
    .table-responsive table {
        min-width: 100% !important;
    }
}