/* =========================================================================
   ملف التنسيق الشامل: historique.css (النسخة النهائية والمكتملة)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');

/* 1. الخلفية العامة */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Amiri', serif;
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.9)), 
                url('../photo%20video/photo/zelidj.jpg');
    background-repeat: repeat;
}

/* 2. أنيميشن نبض الشعار */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.pulse-animation { animation: pulse 2s infinite; }

/* 3. القسم الرئيسي للغلاف */
.royal-book-section {
    padding-top: 150px;
    padding-bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-container {
    width: 90%;
    max-width: 400px;
    background: linear-gradient(rgba(139, 69, 19, 0.65), rgba(139, 69, 19, 0.65)), 
                url('../photo%20video/photo/casbah.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.main-title { font-size: 1.6rem; font-weight: 900; margin: 10px 0; }
.label-text { font-size: 1.1rem; color: #f0f0f0; }

.logo-frame {
    width: 120px; height: 120px; border: 4px solid #006745;
    border-radius: 15px; margin: 15px auto; background: white;
    display: flex; justify-content: center; align-items: center;
}
.logo-frame img { width: 80%; height: auto; }

.btn-browse { background: #006745; color: white; border: none; padding: 10px 30px; border-radius: 20px; font-weight: bold; cursor: pointer; }
.action-icons { display: flex; justify-content: center; gap: 15px; margin-top: 15px; }
.icon-btn { background: #006745; color: white; border: none; padding: 8px 15px; border-radius: 20px; cursor: pointer; }

/* 4. النص أسفل الغلاف */
.summary-text-outside {
    margin-top: 20px;
    max-width: 400px;
    text-align: center;
    color: #5d4037;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 0 20px;
}

.full-width-divider { width: 80%; height: 2px; background: #8B4513; margin: 30px auto; }

/* 5. النوافذ المنبثقة (Popup) - تصميم احترافي */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(5px); z-index: 9999;
}

.modal-body {
    background: rgba(255, 255, 255, 0.98);
    color: #333;
    padding: 30px;
    border-radius: 25px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 2px solid #006745;
    display: flex;
    flex-direction: column;
}

/* زر الإغلاق الموحد (أعلى اليسار) */
.close-modal {
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 35px;
    color: #006745;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}
.close-modal:hover { color: #8B4513; transform: rotate(90deg); }

/* 6. منطقة التمرير داخل النافذة */
#modalContent {
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

/* 7. تصميم الأزرار والأقسام (القائمة الجانبية داخل النافذة) */
.nav-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nav-list li {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 10px;
    border-right: 5px solid #006745;
    cursor: pointer;
    font-weight: bold;
    text-align: right;
    transition: 0.3s;
}
.nav-list li:hover { background: #e0e0e0; transform: translateX(-5px); }

/* 8. تنسيق نافذة اختيار اللغة (عمودية) */
#languageModal .modal-body { align-items: center; text-align: center; }

#langSelect {
    width: 100%;
    padding: 12px;
    margin: 20px 0;
    border-radius: 10px;
    border: 2px solid #006745;
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
}

#languageModal .btn-browse { width: 100%; padding: 12px; }

/* تنسيق زر "موافق" الإضافي */
#languageModal button {
    width: 100%;
    padding: 12px;
    background-color: #006745;
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
#languageModal button:hover { background-color: #8B4513; }

/* 9. أزرار التنقل */
.nav-buttons { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 10px; border-top: 1px solid #ccc; }
.nav-buttons button {
    background: #8B4513; color: white; padding: 8px 20px;
    border-radius: 20px; border: none; cursor: pointer;
}

/* =========================================================================
   ملف التنسيق الشامل: historique.css (النسخة النهائية والمعدلة للهواتف)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');

/* 1. الخلفية العامة */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Amiri', serif;
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), 
                url('../photo%20video/photo/zelidj.jpg');
    background-repeat: repeat;
    overflow-x: hidden; /* لمنع التمرير الأفقي */
}

/* 2. أنيميشن نبض الشعار */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.pulse-animation { animation: pulse 2s infinite; }

/* 3. القسم الرئيسي للغلاف */
.royal-book-section {
    padding-top: 150px;
    padding-bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-container {
    width: 90%;
    max-width: 400px;
    background: linear-gradient(rgba(139, 69, 19, 0.65), rgba(139, 69, 19, 0.65)), 
                url('../photo%20video/photo/casbah.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

.main-title { font-size: 1.6rem; font-weight: 900; margin: 10px 0; }
.label-text { font-size: 1.1rem; color: #f0f0f0; }

.logo-frame {
    width: 120px; height: 120px; border: 4px solid #006745;
    border-radius: 15px; margin: 15px auto; background: white;
    display: flex; justify-content: center; align-items: center;
}
.logo-frame img { width: 80%; height: auto; }

.btn-browse { background: #006745; color: white; border: none; padding: 10px 30px; border-radius: 20px; font-weight: bold; cursor: pointer; }
.action-icons { display: flex; justify-content: center; gap: 15px; margin-top: 15px; }
.icon-btn { background: #006745; color: white; border: none; padding: 8px 15px; border-radius: 20px; cursor: pointer; }

/* 4. النص أسفل الغلاف */
.summary-text-outside {
    margin-top: 20px;
    max-width: 400px;
    text-align: center;
    color: #5d4037;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 0 20px;
}

.full-width-divider { width: 80%; height: 2px; background: #8B4513; margin: 30px auto; }

/* 5. النوافذ المنبثقة (Popup) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(5px); z-index: 9999;
}

.modal-body {
    background: rgba(255, 255, 255, 0.98);
    color: #333;
    padding: 30px;
    border-radius: 25px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 2px solid #006745;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.close-modal {
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 35px;
    color: #006745;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}
.close-modal:hover { color: #8B4513; transform: rotate(90deg); }

#modalContent { max-height: 60vh; overflow-y: auto; padding: 10px; }

/* 6. تنسيق الأزرار والقوائم داخل النوافذ */
.nav-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nav-list li {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 10px;
    border-right: 5px solid #006745;
    cursor: pointer;
    font-weight: bold;
    text-align: right;
    transition: 0.3s;
}
.nav-list li:hover { background: #e0e0e0; transform: translateX(-5px); }

#langSelect {
    width: 100%;
    padding: 12px;
    margin: 20px 0;
    border-radius: 10px;
    border: 2px solid #006745;
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    box-sizing: border-box;
}

#languageModal .btn-browse { width: 100%; padding: 12px; }

.nav-buttons { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 10px; border-top: 1px solid #ccc; }
.nav-buttons button {
    background: #8B4513; color: white; padding: 8px 20px;
    border-radius: 20px; border: none; cursor: pointer;
}

/* 7. التعديل الدقيق للهواتف */
@media (max-width: 600px) {
    .book-container, 
    .modal-body {
        margin-left: 3% !important;
        margin-right: 3% !important;
        width: 94% !important; 
        box-sizing: border-box;
    }
    .close-modal { left: 15px !important; }
}


/* =========================================================================
   ملف historique.css الشامل (النسخة النهائية المحدثة)
   ========================================================================= */

/* 1. حاوية الفلاتر - مسافة 2% وتنسيق عصري */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 2%; /* مسافة 2% بين الخانتين */
    margin: 20px auto;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    padding: 0 10px;
}

.filter-select {
    width: 49%; /* جعل كل خانة تأخذ 49% من العرض */
    padding: 12px 10px;
    border: 2px solid #006745;
    background: #fff;
    color: #006745;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    font-family: 'Amiri', serif;
    appearance: none;
    border-radius: 10px; /* زوايا دائرية */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: 0.3s;
}

.filter-select:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0, 103, 69, 0.5);
}

/* 2. حاوية الكاروسيل */
.carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.card-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    width: 280px;
    padding: 10px 0;
    scrollbar-width: none;
}

/* 3. تنسيق البطاقة - عرض كامل ومناسب */
.media-card {
    flex: 0 0 250px;
    height: 320px;
    scroll-snap-align: center;
    background: #fff;
    border-radius: 15px;
    border: 1px solid #ddd;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s;
}

.media-card:hover { transform: translateY(-5px); }

/* زيادة طول الصورة لتأخذ 160px وملء المساحة بالكامل */
.media-card .cover-image { 
    width: 100%; 
    height: 160px; 
    object-fit: cover; 
    cursor: pointer; 
    display: block; 
}

.media-info { padding: 15px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.media-info h3 { margin: 0 0 10px 0; font-size: 1.1rem; color: #333; }

.btn-archive { background: #006745; color: white; border: none; padding: 10px 20px; border-radius: 10px; cursor: pointer; font-weight: bold; width: 100%; transition: 0.3s; }
.btn-archive:hover { background: #005037; }

/* 4. أزرار التنقل <> */
.nav-arrow {
    background: #8B4513;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* 5. النافذة المنبثقة (Popup Overlay) */
.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-body {
    width: 96% !important; 
    max-width: 500px;
    background: #fff;
    border-radius: 20px;
    padding: 50px 20px 20px 20px; 
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    direction: rtl; 
    text-align: right;
}

/* زر إغلاق شفاف، غليظ جداً، وواضح */
.close-btn {
    color: red !important;
    font-size: 40px; 
    font-weight: 900; 
    cursor: pointer;
    position: absolute;
    top: 5px; 
    left: 15px; 
    right: auto;
    z-index: 1000;
    line-height: 1;
    background: transparent !important; 
    padding: 0 5px;
}

/* 6. التجاوب للهواتف */
@media (max-width: 600px) {
    .filter-select { font-size: 0.85rem; }
    .card-container { width: 250px; }
}















/* ==========================================================
   1. الخطوط الفاصلة
========================================================== */
.memories-royal-green-divider,
.memories-royal-green-divider-bottom {
    width: 100%;
    height: 3px;
    background-color: #006745;
    margin: 0;
}

/* ==========================================================
   2. القسم الرئيسي
========================================================== */
#memories-section {
    width: 100%;
    min-height: 350px;
    background-image: url('../photo%20video/photo/image4.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.memories-overlay-background {
    width: 100%;
    height: 100%;
    min-height: 350px;
    background-color: rgba(255,255,255,0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    box-sizing: border-box;
}

/* ==========================================================
   3. العناوين والنصوص
========================================================== */
.memories-title,
.modal-title {
    color: #006745 !important;
    font-weight: 900 !important;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

.memories-text,
.modal-note {
    color: #8B4513 !important;
    font-weight: 800 !important;
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.7;
}

/* ==========================================================
   4. الحاوية المشتركة للأزرار
========================================================== */
.btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px; /* مسافة صغيرة بين الأزرار فقط */
    margin-top: 20px;
    width: 100%;
}

/* منع تداخل أزرار الإرسال والرجوع */
.btn-group {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

/* ==========================================================
   5. الأزرار (تطوير عصري مع الحفاظ على الأحجام)
========================================================== */
.memories-share-button,
.next-btn,
.btn-video,
.btn-photo,
.back-btn {
    padding: 15px 25px;
    font-size: 1em;
    font-weight: 900;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white !important;
    box-sizing: border-box;
    text-align: center;

    /* مظهر احترافي */
    box-shadow:
        0 4px 12px rgba(0,0,0,0.12),
        0 2px 6px rgba(0,0,0,0.08);
}

/* تأثير عصري */
.memories-share-button:hover,
.next-btn:hover,
.btn-video:hover,
.btn-photo:hover,
.back-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 20px rgba(0,0,0,0.18),
        0 4px 10px rgba(0,0,0,0.12);
}

.memories-share-button:active,
.next-btn:active,
.btn-video:active,
.btn-photo:active,
.back-btn:active {
    transform: scale(0.98);
}

/* زر شارك معنا بني */
.memories-share-button {
    background: linear-gradient(
        135deg,
        #8B4513,
        #A0522D
    ) !important;
}

/* ألوان الأزرار */
.btn-video,
.next-btn {
    background: linear-gradient(
        135deg,
        #006745,
        #00895a
    ) !important;
}

.btn-photo {
    background: linear-gradient(
        135deg,
        #8B4513,
        #A0522D
    ) !important;
}

.back-btn {
    background: linear-gradient(
        135deg,
        #d9534f,
        #c0392b
    ) !important;
}

/* ==========================================================
   6. النافذة المنبثقة (Modal)
========================================================== */
.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
    padding: 15px;
    box-sizing: border-box;
}

.modal.show {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 25px;
    border: 3px solid #006745;
    width: 95%;
    max-width: 500px;
    text-align: center;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ==========================================================
   7. تنظيم المدخلات
========================================================== */
.input-row {
    display: flex;
    flex-direction: column;
    gap: 5px; /* تقليل المسافات بين الخانات */
    margin: 12px 0;
    width: 100%;
}

/* خانات الإدخال */
input,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 15px;
    border: 2px solid #8B4513; /* بني */
    border-radius: 12px;
    box-sizing: border-box;
    overflow: hidden;
    transition: all 0.3s ease;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #006745;
    box-shadow: 0 0 0 3px rgba(0,103,69,0.12);
}

/* خانة رفع الصورة */
.upload-label {
    display: block;
    padding: 20px;
    border: 2px dashed #8B4513;
    border-radius: 12px;
    cursor: pointer;
    color: #006745;
    font-weight: 900;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.upload-label:hover {
    background: rgba(139,69,19,0.06);
}

/* ==========================================================
   8. الرسائل التنبيهية
========================================================== */
.error-msg {
    display: block;
    width: 100%;
    color: #d60000 !important;
    font-size: 0.85em;
    font-weight: 900 !important;
    text-align: right;
    line-height: 1.5;
    margin-top: 4px;
    margin-bottom: 2px;
    word-break: break-word;
}

/* حدود التحقق */
.error-border {
    border: 2px solid #d60000 !important;
}

.success-border {
    border: 2px solid #006745 !important;
}

.close-btn {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 30px;
    color: #8B4513;
    cursor: pointer;
}

/* ==========================================================
   9. شاشة التحميل
========================================================== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.98);
    z-index: 20000;
    justify-content: center;
    align-items: center;
}

.loading-container {
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* الأيقونات المتحركة */
.icon-marquee {
    display: flex;
    gap: 80px;
    font-size: 40px;
    color: #006745;
    white-space: nowrap;
    animation: marquee 6s linear infinite;
}

.icon-marquee.bottom {
    animation: marquee-reverse 6s linear infinite;
}

/* النوطات الموسيقية */
.music-notes-container {
    display: flex;
    gap: 30px;
    font-size: 50px;
    color: #A0522D;
}

.note {
    animation: float 2s ease-in-out infinite;
}

.note:nth-child(2) {
    animation-delay: 0.6s;
}

.note:nth-child(3) {
    animation-delay: 1.2s;
}

/* الحركات */
@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes marquee-reverse {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes float {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-25px);
    }
}

.loading-text {
    font-weight: bold;
    color: #333;
    font-size: 1.3em;
    margin-top: 10px;
}

/* ==========================================================
   10. التجاوب الكامل
========================================================== */
@media (max-width: 768px) {

    .modal-content {
        width: 100%;
        padding: 24px 16px;
    }

    .btn-group {
        flex-direction: column;
        gap: 10px;
    }

    /* الحفاظ على نفس الحجم */
    .memories-share-button,
    .next-btn,
    .btn-video,
    .btn-photo,
    .back-btn {
        max-width: 250px;
    }
}

@media (max-width: 480px) {

    #memories-section {
        background-attachment: scroll;
    }

    .btn-container {
        gap: 8px;
    }

    .btn-group {
        gap: 8px;
    }
}

