/* Project: Arshif Mohammad Al-Halawani
   Engineer: Rasha Barghol
   Theme: Gold & Dark Professional
*/

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
    --primary-yellow: #ffc107ad; 
    --gold-dark: #d4a017;
    --dark-black: #121212;      
    --soft-black: #1E1E1E;      
}

body { 
    font-family: 'IBM Plex Sans Arabic', sans-serif; 
    background-color: var(--dark-black); 
    color: #ffffff; 
    line-height: 1.8; 
    scroll-behavior: smooth; 
    overflow-x: hidden;
}

/* --- Navbar --- */
.navbar { background-color: rgba(0,0,0,0.95); border-bottom: 2px solid var(--primary-yellow); padding: 12px 0; }
.navbar .nav-link { color: var(--primary-yellow); font-weight: 600; margin-left: 15px; text-decoration: none; }
.navbar .nav-link:hover { color: #ffffff; }

/* --- General Sections --- */
.hero-section { padding: 80px 0; }

.section-title { width: fit-content; border-bottom: 4px solid var(--primary-yellow); padding-bottom: 10px; margin-bottom: 40px; font-weight: 700; }
.section-divider { height: 3px; width: 60px; background-color: var(--gold-dark); margin: 15px auto; border-radius: 2px; }
/* إجبار خلفية الموقع كاملة */
html, body { 
    background-color: #121212 !important; 
}

/* تعريف خلفية كرت الصورة في صفحة الاندكس */
.bg-soft-black {
    background-color: #1E1E1E !important;
}

/* تعريف الكرت في صفحة About ليكون أسود بدل الأبيض */
.article-card {
    background-color: #1E1E1E !important;
    border: 1px solid #ffc107ad; /* نفس لون الذهب عندك */
    border-radius: 15px;
}

/* --- About Section --- */
.about-profile-img {
    width: 240px; height: 320px; object-fit: cover; border-radius: 12px;
    border: 3px solid var(--primary-yellow); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.about-profile-img-hero {
    max-width: 100%;
    height: auto;
    border: 3px solid var(--primary-yellow);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    transition: transform 0.3s ease;
}
.about-profile-img-hero:hover { transform: scale(1.02); }

.hero-section .lead {
    text-align: justify;
    text-justify: inter-word;
    line-height: 1.8;
}
.about-img-container {
    transition: transform 0.3s ease;
}

.about-img-container:hover {
    transform: scale(1.02); /* تكبير بسيط عند التمرير */
}

.about-profile-img {
    border: 2px solid var(--primary-yellow);
    border-radius: 15px;
    max-width: 300px; /* أو حسب الحجم اللي عندك */
}

/* تنسيق زر الإغلاق في المودال */
.modal-content .btn-close {
    float: left;
    filter: invert(1); /* جعل زر الإغلاق أبيض ليتناسب مع الثيم الأسود */
}

@media (max-width: 991px) {
    .hero-section .text-lg-end { text-align: center; }
    .hero-section .lead { text-align: center; }
}

/* --- Buttons --- */
.btn-outline-warning { border-width: 2px; transition: all 0.4s ease; border-color: var(--primary-yellow); color: var(--primary-yellow); }
.btn-outline-warning:hover {
    background-color: var(--primary-yellow);
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

/* --- Cards General --- */
.category-card { 
    background-color: var(--soft-black); 
    border: 1px solid #333; 
    padding: 30px 15px; 
    border-radius: 18px; 
    transition: 0.4s; 
    height: 100%;
}
.category-card:hover { border-color: var(--primary-yellow); transform: translateY(-5px); }
.card-icon { font-size: 2.5rem; color: var(--primary-yellow); margin-bottom: 15px; display: block; }
.category-card .card-title { color: #ffffff; font-weight: 600; font-size: 1.1rem; }

/* --- Investigations Section --- */
.investigation-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 193, 7, 0.1);
    border-radius: 15px;
    padding: 20px; 
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.investigation-item:hover {
    border-color: var(--primary-yellow);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
}
.inv-title { color: var(--gold-dark); font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }
.inv-description { color: #eee; font-size: 0.95rem; line-height: 1.6; margin-bottom: 15px; text-align: justify; }

.inv-img-container { 
    width: 100%; 
    height: 280px; 
    border-radius: 10px; 
    overflow: hidden; 
    border: 1px solid #333; 
    background: transparent; 
    display: flex;
    align-items: flex-start; 
    justify-content: center;
    margin-top: auto; 
}
.inv-img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    object-position: top; 
    transition: transform 0.5s ease; 
    cursor: pointer; 
}
.inv-img:hover { transform: scale(1.05); }

/* --- Book Covers --- */
.book-cover-container { width: 100%; height: 350px; overflow: hidden; background-color: #000; border-bottom: 2px solid var(--primary-yellow); }
.book-img { width: 100%; height: 100%; object-fit: contain; transition: 0.5s ease; }
.category-card:hover .book-img { transform: scale(1.1); }

/* --- Modals --- */
.modal-content { background-color: #0f0f0f; border: 1px solid var(--primary-yellow); border-radius: 20px; }
.modal-header { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.modal-body { color: #e0e0e0; line-height: 1.8; }
.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

#contact-us {
    background-color: var(--dark-black);
    color: white;
}

/* الإطار الأصفر وتساوي الطول */
.border-yellow-custom {
    border: 2px solid var(--primary-yellow);
    border-radius: 15px;
    padding: 30px;
    background-color: var(--soft-black);
    height: 100%; /* مهم جداً لتساوي الصندوقين */
    display: flex;
    flex-direction: column;
}

/* شبكة الأيقونات */
.social-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 أعمدة في السطر */
    gap: 15px;
    margin-top: 20px;
}

.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: white !important;
    transition: 0.3s;
}

.social-item i {
    font-size: 1.6rem;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

/* تأثير الهوفر للأيقونات */
.social-item:hover i, .social-item:hover span {
    color: var(--primary-yellow) !important;
}

/* تنسيق الفورم */
.contact-form .form-control {
    background-color: transparent;
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: white;
    padding: 10px;
}
/* تأكد أن الحاوية الكبيرة للأقسام تسمح بالتمدد */
.align-items-stretch {
    align-items: stretch !important;
}

/* تنسيق الفورم كحاوية مرنة */
.contact-form {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100%; /* تضمن أن يأخذ الارتفاع الكامل للحاوية الصفراء */
}

/* إجبار الـ Wrapper والـ Textarea على النمو */
.message-wrapper {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important; /* يطلب من الحاوية أخذ كل مساحة الفراغ */
}

.message-wrapper textarea {
    flex-grow: 1 !important; /* يطلب من حقل النص التمدد داخل الحاوية */
    min-height: 150px; /* لضمان عدم صغر الحجم في الشاشات الصغيرة */
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.contact-form .form-control:focus {
    border-color: var(--primary-yellow);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    color: white;
}

.contact-form label {
    color: var(--primary-yellow);
    margin-bottom: 5px;
}

/* لتنسيق الموبايل */
@media (max-width: 991px) {
    .social-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* تقليل المسافات بين الصفوف في الفورم */
.contact-form .row {
    --bs-gutter-y: 1rem; /* تقليل الفراغ العمودي بين الحقول */
}

/* جعل الفورم عبارة عن Flex Container */
.contact-form {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100%; /* تضمن أن يأخذ الارتفاع الكامل للحاوية الصفراء */
}

/* جعل حاوية الحقول تتمدد */
.flex-content-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* جعل حقل الرسالة يأخذ كل المساحة المتبقية */
.message-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.message-wrapper textarea {
    flex-grow: 1; /* هذا سيجعل المربع يتمدد للأسفل ليملأ الفراغ */
    min-height: 150px; /* حد أدنى للطول */
    resize: none; /* لمنع المستخدم من تخريب التصميم */
}

/* زر التعديل */
.btn-edit { color: var(--gold); border: 1px solid rgba(255, 193, 7, 0.3); }
.btn-edit:hover { background: var(--gold); color: #000; box-shadow: 0 0 10px rgba(255, 193, 7, 0.2); }


/* ستايل معرض الصور المصغر */
.gallery-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px; /* تقليل الحشو لتقليل الطول */
    transition: transform 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-5px);
    border-color: #ffc107;
}

.gallery-card-title {
    min-height: 2.5rem; /* توحيد ارتفاع العنوان */
    line-height: 1.3;
}

.gallery-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* عرض سطرين فقط من الوصف */
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 35px;
}

.gallery-img-wrapper {
    height: 180px; /* تحديد ارتفاع أصغر للصورة لتقليل طول الكارد */
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* لقص الصورة بشكل متناسق دون تمطيط */
    cursor: pointer;
    transition: 0.5s all;
}

.gallery-card:hover .gallery-img {
    transform: scale(1.1);
}