/* ==========================================================================
   1. المتغيرات والخطوط الأساسية (Premium Dark Cinema Style)
   ========================================================================== */
:root {
    --body-bg: #0b0c10;
    --card-bg: #1f2833;
    --primary-cyan: #00b4d8;
    --text-white: #ffffff;
    --text-gray: #94a3b8;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--body-bg);
    color: var(--text-white);
    font-family: var(--font-main);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   2. الهيدر واللوغو والـ Navigation
   ========================================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: rgba(11, 12, 16, 0.95);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.logo {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-white);
    text-decoration: none;
    letter-spacing: 1px;
}

.logo span {
    color: var(--primary-cyan);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 18px;
    color: var(--text-white);
}

.nav-actions i {
    cursor: pointer;
    transition: color 0.2s;
}

.nav-actions i:hover {
    color: var(--primary-cyan);
}

/* ==========================================================================
   3. السلايدر الرئيسي ديناميكي (Hero Slider)
   ========================================================================== */
.hero-slider-container {
    position: relative;
    width: 100%;
    height: 480px;
    background-color: #000;
    margin-top: 60px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center 20%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: flex-end;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #0b0c10 5%, rgba(11,12,16,0.5) 50%, rgba(11,12,16,0.3) 100%);
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 0 5% 40px 5%;
    max-width: 600px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-white);
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #e2e8f0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.badge-cyan {
    background-color: var(--primary-cyan);
    color: #000;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.badge-outline {
    border: 1px solid #64748b;
    color: #cbd5e1;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.rating-star {
    color: #ffb703;
}

.btn-watch {
    background-color: var(--primary-cyan);
    color: #000;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0, 180, 216, 0.4);
    transition: transform 0.2s;
}

.btn-watch:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   4. الأقسام وهيكلة الـ Grids والـ Sliders الأفقية
   ========================================================================== */
.main-content {
    padding: 20px 0;
}

.section-wrapper {
    margin-bottom: 30px;
    padding: 0 5%;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.section-icon {
    color: var(--primary-cyan);
    font-size: 18px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trending-slider-wrapper {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 5px 2px 15px 2px;
    scrollbar-width: none;
}

.trending-slider-wrapper::-webkit-scrollbar {
    display: none;
}

.trending-slider-wrapper .movie-card {
    min-width: 140px;
    max-width: 140px;
    flex-shrink: 0;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media(min-width: 480px) {
    .movies-grid { grid-template-columns: repeat(3, 1fr); }
    .trending-slider-wrapper .movie-card { min-width: 150px; max-width: 150px; }
}
@media(min-width: 768px) {
    .movies-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
    .trending-slider-wrapper { gap: 20px; }
    .trending-slider-wrapper .movie-card { min-width: 170px; max-width: 170px; }
}
@media(min-width: 1024px) {
    .movies-grid { grid-template-columns: repeat(6, 1fr); }
}

.movie-card {
    background-color: transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.movie-card:hover {
    transform: translateY(-5px);
}

.poster-box {
    position: relative;
    width: 100%;
    padding-top: 145%;
    background-size: cover;
    background-position: center;
    background-color: #1a1f26;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.hd-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: var(--primary-cyan);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 3px;
    text-transform: uppercase;
}

.card-info {
    padding: 8px 2px;
}

.card-meta {
    font-size: 11px;
    color: var(--text-gray);
    margin-bottom: 4px;
    display: flex;
    gap: 5px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
    animation: loadingSkeleton 1.5s infinite;
}

@keyframes loadingSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   5. ستايل المشغل (مقاد 100% للأفلام العادية والمسلسلات)
   ========================================================================== */
.movie-page-body {
    padding-top: 60px; 
}

.player-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px 12px 5px 12px;
}

/* الإطار الخارجي للمشغل: أبعاد سينمائية حقيقية ونظيفة للأفلام */
.video-player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* أبعاد 16:9 مضبوطة تماماً */
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 30px rgba(0,0,0,0.8);
    margin-bottom: 15px;
}

/* الـ iframe العادي للأفلام: كيشد البلاصة كاملة مريقل */
.video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ⚡ كلاس سحري خاص بالمسلسلات فقط (كيتحكم فيه الـ JS) لقص السواد ف الموبايل */
.video-player-wrapper.tv-mode iframe {
    height: 135%;
    top: 50%;
    transform: translateY(-50%);
}

/* أزرار المشاهدة والسيرفرات تحت المشغل */
.player-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
    padding: 0 2%;
}

.btn-player-action {
    flex: 1;
    max-width: 180px;
    background: transparent;
    border: 1.5px solid #64748b;
    color: #cbd5e1;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-player-action:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
    transform: translateY(-1px);
}

/* ==========================================================================
   6. سيكشن اختيار المواسم والحلقات
   ========================================================================== */
#tvSelectorContainer {
    width: 100%;
    max-width: 1000px;
    margin: 20px auto;
    padding: 15px;
    background-color: #151a22;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#seasonSelect {
    width: 100%;
    max-width: 200px;
    padding: 10px 12px;
    background-color: #0b0c10;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    margin-bottom: 15px;
    display: block;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

#episodesGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 8px;
    width: 100%;
}

.ep-btn {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0b0c10;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ep-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

/* المعطيات والتفاصيل النصية للفيلم/المسلسل */
.movie-details-info {
    padding: 15px 5%;
}

.movie-main-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-white);
}

.movie-story {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.6;
    margin: 15px 0;
}

.movie-sub-meta {
    font-size: 13px;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.movie-sub-meta strong {
    color: var(--text-gray);
    font-weight: 500;
    margin-right: 5px;
}

/* ==========================================================================
   7. قائمة المقترحات الجانبية/التحتية (Recommended List)
   ========================================================================== */
.rec-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 5% 40px 5%;
    margin-top: 15px;
}

.rec-item-row {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    background-color: rgba(31, 40, 51, 0.4);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.02);
    transition: transform 0.2s, background-color 0.2s;
}

.rec-item-row:hover {
    transform: translateX(6px);
    background-color: rgba(31, 40, 51, 0.8);
}

.rec-thumb {
    width: 60px;
    height: 85px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    background-color: #1a1f26;
    flex-shrink: 0;
}

.rec-text-side {
    flex: 1;
    overflow: hidden;
}

.rec-meta-line {
    font-size: 11px;
    color: var(--text-gray);
    margin-bottom: 5px;
}

.rec-movie-title {
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
