* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
    background: #0f0f1a;
    color: #fff;
}

/* الهيدر */
header {
    background: rgba(15, 15, 26, 0.95);
    padding: 15px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid #e50914;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e50914;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    transition: 0.3s;
}

nav a:hover {
    color: #e50914;
}

.search-box input {
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    background: #1e1e2f;
    color: #fff;
    outline: none;
    width: 250px;
}

/* البانر */
.hero {
    height: 400px;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)),
                url('https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?w=1600') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #ccc;
}

.hero button {
    padding: 12px 40px;
    background: #e50914;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.hero button:hover {
    background: #b00710;
    transform: scale(1.05);
}

/* الأقسام */
.section {
    padding: 50px 40px;
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    border-right: 4px solid #e50914;
    padding-right: 15px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #aaa;
    padding: 30px;
}

/* الكارد */
.card {
    background: #1e1e2f;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(229, 9, 20, 0.4);
}

.card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.card-info {
    padding: 15px;
}

.card-info h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #aaa;
}

.rating {
    color: #ffc107;
    font-weight: bold;
}

/* النافذة المنبثقة */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1e1e2f;
    padding: 25px;
    border-radius: 15px;
    max-width: 800px; /* تكبير النافذة لتتناسب مع مشغل الفيديو */
    width: 95%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* تخصيص شكل شريط التمرير */
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-track {
    background: #0f0f1a; 
    border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: #e50914; 
    border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: #b00710; 
}

.close {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #e50914;
    z-index: 10;
}

.modal-content img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.modal-content h2 {
    margin-bottom: 15px;
}

.modal-content p {
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 15px;
}

/* الفوتر */
footer {
    background: #05050d;
    text-align: center;
    padding: 25px;
    color: #888;
    border-top: 2px solid #e50914;
}

/* الموبايل */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    .hero h1 { font-size: 2rem; }
    .section { padding: 30px 15px; }
    .search-box input { width: 100%; }
}