@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap');

:root {
    --bg-dark: #0a0a0f;
    --bg-panel: #14141d;
    --primary: #ff2a40;
    --text-main: #ffffff;
    --text-dim: #8b8b99;
    --sidebar-w: 250px;
    --bottom-nav-h: 65px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Cairo', sans-serif; outline: none; }
body { background: var(--bg-dark); color: var(--text-main); overflow-x: hidden; }

/* الهيكل المرن - سر التناسق */
.layout-wrapper { display: flex; width: 100%; min-height: 100vh; }

/* الشريط الجانبي للكمبيوتر */
.desktop-sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-panel); border-left: 1px solid #1f1f2e; display: flex; flex-direction: column; padding: 25px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-size: 26px; font-weight: 900; margin-bottom: 40px; text-align: center; letter-spacing: 2px;}
.brand span { color: var(--primary); }
.side-nav { display: flex; flex-direction: column; gap: 10px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 15px; text-decoration: none; color: var(--text-dim); font-weight: 700; border-radius: 10px; transition: 0.3s; }
.side-nav a i { font-size: 22px; }
.side-nav a:hover, .side-nav a.active { background: rgba(255, 42, 64, 0.1); color: var(--primary); }

/* المحتوى الرئيسي */
.main-content { flex-grow: 1; max-width: calc(100% - var(--sidebar-w)); display: flex; flex-direction: column; }

/* البار العلوي */
.top-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 4%; background: rgba(10, 10, 15, 0.9); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid #1f1f2e; }
.search-container { display: flex; align-items: center; background: var(--bg-panel); border-radius: 20px; padding: 8px 15px; border: 1px solid #1f1f2e; width: 100%; max-width: 400px; }
.search-container i { color: var(--text-dim); font-size: 20px; }
.search-container input { background: transparent; border: none; color: #fff; padding: 0 10px; width: 100%; }
.user-module { display: flex; align-items: center; gap: 15px; }
.premium-badge { background: linear-gradient(45deg, #ff2a40, #ff7b00); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 900; }
.user-module i { font-size: 32px; cursor: pointer; }

/* القسم البطل */
.hero-module { position: relative; width: 100%; height: 50vh; min-height: 400px; display: flex; align-items: flex-end; padding: 4%; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg-dark) 0%, transparent 60%), linear-gradient(to right, rgba(10,10,15,0.8) 0%, transparent 100%); z-index: -1; }
.hero-data { max-width: 600px; position: relative; z-index: 10; margin-bottom: 20px; }
.hero-title { font-size: 40px; font-weight: 900; line-height: 1.1; margin-bottom: 10px; text-shadow: 0 4px 10px rgba(0,0,0,0.8); }
.hero-desc { color: #ccc; margin-bottom: 20px; font-size: 16px; }
.action-btn { background: var(--primary); color: #fff; border: none; padding: 12px 25px; border-radius: 8px; font-size: 16px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.3s; }
.action-btn:hover { transform: scale(1.05); box-shadow: 0 10px 20px rgba(255, 42, 64, 0.4); }

/* شبكة الكروت (بدون تداخل اطلاقا) */
.content-block { padding: 0 4% 40px; }
.block-title { font-size: 22px; font-weight: 900; margin-bottom: 20px; border-right: 4px solid var(--primary); padding-right: 12px; }
.grid-system { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
.media-card { background: var(--bg-panel); border-radius: 12px; overflow: hidden; cursor: pointer; border: 1px solid #1f1f2e; transition: 0.3s; }
.media-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.card-image-wrapper { position: relative; aspect-ratio: 16/9; background: #000; overflow: hidden; }
.card-image-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.media-card:hover .card-image-wrapper img { transform: scale(1.1); filter: brightness(0.7); }
.play-overlay { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; opacity: 0; transition: 0.3s; }
.play-overlay i { font-size: 50px; color: #fff; text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.media-card:hover .play-overlay { opacity: 1; }
.card-meta { padding: 12px; }
.card-meta h3 { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* مشغل الفيديو (نافذة معزولة) */
.cinema-modal { position: fixed; inset: 0; z-index: 9999; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: 0.3s; padding: 20px; }
.cinema-modal.active { opacity: 1; pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.95); backdrop-filter: blur(5px); }
.modal-content { position: relative; width: 100%; max-width: 900px; background: #000; border-radius: 16px; border: 1px solid #333; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,1); transform: scale(0.95); transition: 0.3s; }
.cinema-modal.active .modal-content { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; position: absolute; top: 0; width: 100%; background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent); z-index: 10; }
.modal-header h2 { font-size: 16px; color: #fff; }
#closeModalBtn { background: none; border: none; color: #fff; font-size: 30px; cursor: pointer; }
.video-ratio-box { width: 100%; aspect-ratio: 16/9; position: relative; background: #000; }
video { width: 100%; height: 100%; display: block; }
.spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 40px; color: var(--primary); display: none; }

/* شريط الموبايل السفلي */
.mobile-bottom-nav { display: none; position: fixed; bottom: 0; width: 100%; height: var(--bottom-nav-h); background: rgba(20, 20, 29, 0.98); border-top: 1px solid #1f1f2e; z-index: 1000; justify-content: space-around; align-items: center; }
.mobile-bottom-nav a { color: var(--text-dim); font-size: 26px; padding: 10px; transition: 0.3s; }
.mobile-bottom-nav a.active { color: var(--primary); transform: translateY(-3px); }

/* التحكم بالتجاوب للشاشات (Mobile/Tablet) */
@media (max-width: 900px) {
    .desktop-sidebar { display: none; }
    .main-content { max-width: 100%; padding-bottom: calc(var(--bottom-nav-h) + 20px); }
    .mobile-bottom-nav { display: flex; }
    .hero-title { font-size: 28px; }
    .grid-system { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
