/* style.css */

/* نمط الخط */
body {
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
}

/* أنماط لرسائل الحالة */
.message.success {
    background-color: #1a472a;
    color: #4CAF50;
    border: 1px solid #28a745;
}

.message.error {
    background-color: #4a1c1f;
    color: #FF6347;
    border: 1px solid #dc3545;
}

/* نمط لزر المفضلة عند إضافته */
.favorite-btn.added, #favoriteButton.added {
    background-color: #dc2626 !important;
    border-color: #ef4444 !important;
    color: white !important;
}

/* نمط لتحميل الصور الكسول (Placeholder) */
.lazy-load {
    background-color: #374151;
}

/* لضمان أبعاد متناسقة للصور */
.object-cover {
    object-fit: cover;
}

/* تنسيق الشبكة الأفقي للمجموعات */
.movie-series-grid {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 1rem;
    justify-content: flex-start;
}

/* تنسيق الشبكة الرأسي (لصفحة المفضلة مثلاً) */
.movie-series-grid.grid {
    display: grid;
    /* تحديد عدد الأعمدة ليكون 3 على الأقل في السطر الواحد */
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 1.5rem;
    overflow-x: visible;
    justify-content: center;
}

/* توسيط وتوحيد حجم البطاقات المستطيلة */
.movie-card {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 9rem;
    height: auto;
    background-color: #1f2937;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease-in-out;
    margin: 0 auto;
}

.movie-card:hover {
    transform: scale(1.05);
}

.movie-card img {
    height: 12rem;
    width: 100%;
    object-fit: cover;
}

/* تعديل: ضبط حجم خط العنوان ليتناسب مع البطاقة */
.movie-card h3 {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    padding: 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* نمط لبطاقة القسم */
.category-card {
    height: 10rem;
    width: 10rem;
}

/* نمط للتحكم بظهور أزرار التصفية */
.filter-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.filter-buttons .filter-btn.active-category-filter {
    background-color: #3b82f6;
    color: #fff;
}

.filter-buttons .filter-btn:hover {
    background-color: #2563eb;
}

/* التعديل الجديد: إظهار قائمة الحلقات عند إضافة فئة expanded */
.episode-list.expanded {
    display: block !important;
}

.season-title.expanded .material-icons {
    transform: rotate(90deg);
}

/* تعديل لتنسيقات الجوال */
@media (max-width: 640px) {
    .movie-series-grid.grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .movie-card {
        width: auto;
    }
    .movie-card img {
        height: 10.5rem;
    }
    .movie-card h3 {
        font-size: 0.75rem;
    }
    .header .search-bar input {
        width: 70%;
    }
}

/* تعديل: توسيط محتوى الشريط السفلي */
.bottom-nav {
    display: flex;
    justify-content: center;
    /* توسيط العناصر كمجموعة واحدة */
    gap: 2rem;
    /* إضافة مسافة بين العناصر */
    padding: 0.75rem 0;
}
/* Styles for the dialog overlay */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensures the dialog is on top of other content */
}

/* Styles for the dialog content box */
.dialog-content {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
}

/* Styles for the title and message */
.dialog-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.dialog-message {
    font-size: 1rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

/* Styles for the buttons container */
.dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* General button styles */
.dialog-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

/* Primary button style */
.dialog-button-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.dialog-button-primary:hover {
    background-color: #2563eb;
    transform: scale(1.05);
}

/* Secondary button style */
.dialog-button-secondary {
    background-color: #6b7280;
    color: #ffffff;
}

.dialog-button-secondary:hover {
    background-color: #4b5563;
    transform: scale(1.05);
}

/* Styles for the "Don't show again" checkbox */
.dialog-hide-again-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.dialog-hide-again-container input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.dialog-hide-again-container label {
    font-size: 0.875rem;
    color: #9ca3af;
    cursor: pointer;
}
