/* Movies Section - Cinematic Dark Theme */

html {
    overflow-x: hidden;
    width: 100%;
}

body.movies-mode {
    display: block !important;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden !important;
    position: relative;
    background: radial-gradient(at 0% 0%, rgba(229, 9, 20, 0.1) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 0, 0, 0.5) 0, transparent 50%),
        radial-gradient(at 50% 100%, rgba(10, 10, 10, 1) 0, transparent 50%);
}

body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
    width: 100% !important;
    /* Removed position: fixed to prevent potential layout collapse */
}

:root {
    --movies-primary: #E50914;
    --movies-secondary: #B81D24;
    --movies-accent: #f5f5f1;
    --movies-glow: rgba(229, 9, 20, 0.6);
    --movies-bg-black: #080808;
    --movies-glass: rgba(255, 255, 255, 0.05);
    --movies-glass-stroke: rgba(255, 255, 255, 0.1);
}

.movies-mode .app-container {
    display: block !important;
    width: 100% !important;
    max-width: 1600px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 40px !important;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden !important;
}

/* Custom Scrollbar */
.movies-mode::-webkit-scrollbar {
    width: 8px;
}

.movies-mode::-webkit-scrollbar-track {
    background: var(--movies-bg-black);
}

.movies-mode::-webkit-scrollbar-thumb {
    background: var(--movies-glass-stroke);
    border-radius: 10px;
    border: 2px solid var(--movies-bg-black);
}

.movies-mode::-webkit-scrollbar-thumb:hover {
    background: var(--movies-primary);
}

.flag-icon {
    display: inline-block;
    width: 20px;
    height: auto;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 2px;
}

.movies-mode .app-container {
    direction: rtl;

    color: #dedede;
    font-family: 'Inter', 'Noto Kufi Arabic', sans-serif;
}

/* Header Styling */
.movies-mode .logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.movies-mode .logo svg {
    stroke: var(--movies-primary);
    filter: drop-shadow(0 0 10px var(--movies-glow));
}

.movies-mode .logo h1 {
    font-weight: 900;
    color: #fff;
    letter-spacing: 1px;
}

.movies-mode .logo h1 span:first-child {
    color: var(--movies-primary);
}

/* Back to Main Button */
.back-to-main {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--movies-glass);
    border: 1px solid var(--movies-glass-stroke);
    border-radius: 100px;
    color: #bbb;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-to-main:hover {
    background: #fff;
    color: #d80c10;
    transform: translateY(-2px);
    border-color: #fff;
}

/* Layout - Netflix Style Grid */
.movies-mode .hub-wrapper {
    margin-top: 20px;
    padding: 0 20px;
    display: block;
    /* Override flex from style.css */
}

.movies-mode .hub-label {
    display: none;
    /* Hide label for cleaner look */
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Search & Filter Bar */
.search-filter-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    margin-top: 10px;
}

.movies-search-container {
    position: relative;
    flex: 1;
    /* Search takes most space */
}

.movies-search-container input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.3s ease;
}

.movies-search-container input:focus {
    border-color: var(--movies-primary);
    background: rgba(255, 255, 255, 0.05);
    outline: none;
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.2);
}

.filter-container {
    width: 160px;
    /* Fixed width for dropdown */
}

#genre-filter,
#type-filter {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    padding-left: 40px;
}

#genre-filter:hover,
#type-filter:hover {
    border-color: var(--movies-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

#genre-filter:focus,
#type-filter:focus {
    border-color: var(--movies-primary);
    background-color: rgba(255, 255, 255, 0.05);
    outline: none;
}

#genre-filter option,
#type-filter option {
    background: #111;
    color: #fff;
}

@media (max-width: 600px) {
    .search-filter-wrapper {
        flex-direction: row;
        /* Keep them side by side */
        gap: 8px;
        margin-bottom: 20px;
    }

    .movies-search-container input {
        padding: 10px 35px 10px 10px;
        /* More compact */
        font-size: 13px;
    }

    .filter-container {
        width: 130px;
        /* Slightly narrower on mobile */
    }

    #genre-filter {
        padding: 10px 10px 10px 30px;
        /* More compact */
        font-size: 13px;
        background-position: left 10px center;
    }
}

.movies-search-container svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

/* Movie Card */
.movie-card {
    position: relative;
    border-radius: 12px;
    overflow: visible;
    /* Restore to allow titles below to show */
    background: transparent;
    /* No background needed for the link wrapper */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    aspect-ratio: auto;
    /* Let the content define the height */
    display: block;
    text-decoration: none !important;
    /* Force remove blue underline */
    color: inherit !important;
    height: auto;
    margin-bottom: 25px;
}

.movie-card * {
    text-decoration: none !important;
    /* Ensure children don't underline */
}

/* Type Badge */
.movie-type-badge {
    position: absolute;
    color: #fff;
    z-index: 5;
    top: 0;
    left: 0;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .5px;
    padding: 5px 10px;
    border-radius: 10px 0px 10px 0px;
    text-transform: uppercase;
    left: 0;
    right: auto;
}

.movie-type-badge.series {
    background: rgba(229, 9, 20, 0.9);
    /* Red for series */
}

.movie-type-badge.movie {
    background: rgba(0, 0, 0, 0.6);
    /* Dark for movies, maybe hide it? */
    display: none;
    /* Usually implied */
}

/* Special Badge for Most Watched */
.movie-type-badge.special {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    left: auto;
    right: 0;
    border-radius: 0 10px 0 10px;
    z-index: 6;
    padding: 6px 14px;
    font-size: 11px;
}

.movie-card:hover {
    z-index: 10;
}

/* Poster Wrapper for Unified Scaling (Default for standard cards) */
.movie-poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: visible;
    /* Allows shadow and scale to expand outside */
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: #000;
}

.movie-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: transform;
    /* Optimize for GPU performance */
}

/* Default Hover Effect for standard cards (Whole Unit Scales) */
.movie-card:hover .movie-poster-wrapper {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    z-index: 10;
}

/* Hero-Specific Hover Effect (Internal Zoom Only) */
.hero-card .movie-poster-wrapper {
    overflow: hidden !important;
    /* Contains the zoom */
    border-radius: 12px;
}

.hero-card:hover .movie-poster-wrapper {
    transform: none !important;
    /* Reset whole-wrapper scaling */
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8);
}

.hero-card:hover .movie-poster {
    transform: scale(1.15);
    /* Internal image zoom-in */
}

.movie-info-overlay {
    position: static;
    background: transparent;
    opacity: 1;
    padding: 12px 2px 0 2px;
    width: 100%;
    text-align: right;
}

.movie-card:hover .movie-info-overlay {
    opacity: 1;
}

.movie-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    font-size: 10px;
    color: #ccc;
}

/* Modal Player */
.movie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.movie-modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content-wrapper {
    width: 95%;
    max-width: 1000px;
    max-height: 94vh;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
    position: relative;
    box-shadow: 0 0 50px rgba(229, 9, 20, 0.1);
    display: flex;
    flex-direction: column;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-modal-btn:hover {
    background: #E50914;
}

/* Override existing player container in modal */
.movies-mode .player-container-modern {
    border: none;
    box-shadow: none;
    background: #000;
    border-radius: 0;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    /* Prevent clipping issues */
}

/* Modal Details */
.modal-details {
    padding: 15px 20px !important;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
    flex: 1;
}

#channel-note-display .channel-note-wrapper {
    width: 100%;
    margin: 0;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    /* Matching side-bar or glass look */
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffc107;
    font-size: 13px;
    font-weight: 700;
}

#channel-note-display .channel-note-wrapper svg {
    color: #ffc107;
    flex-shrink: 0;
    filter: drop-shadow(0 0 5px rgba(255, 193, 7, 0.3));
}

.modal-title {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 8px;
}

.modal-meta {
    color: #999;
    font-size: 14px;
}

/* Hide Old Elements */
.movies-mode .channels-hub,
.movies-mode .hub-label {
    display: none !important;
}

/* Server Switcher in Modal */
.modal-servers {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

@media (max-width: 600px) {
    .movies-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 columns on mobile like Netflix */
        gap: 8px;
        padding: 0 10px;
    }


    .modal-content-wrapper {
        width: 100%;
        height: auto;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .movies-mode .player-container-modern {
        width: 100%;
        flex-shrink: 0;
    }

    .modal-details {
        flex: 1;
        overflow-y: auto;
        padding: 0 !important;
    }

    .close-modal-btn {
        top: 15px !important;
        right: 15px !important;
        z-index: 100;
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(5px);
        border-radius: 50%;
        padding: 5px;
    }
}

.movies-mode .live-indicator-on-screen {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-bottom: 2px solid var(--movies-primary);
    color: #fff;
    box-shadow: none;
    border-radius: 0 0 8px 8px;
    top: 0;
    right: 20px;
    left: auto;
    transform: none;
    padding: 5px 15px;
}

/* Server Switcher */
/* Server/Episode List Container */
.movies-server-selection {
    display: none;
    margin-top: 10px;
    width: 100%;
}

.modal-movie-description {
    font-size: 14px;
    line-height: 1.6;
    color: #ccc;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-right: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #eee;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: var(--movies-primary);
    border-radius: 2px;
}

.servers-grid {
    display: flex;
    flex-wrap: wrap;
    /* Wrap buttons for a clean list look */
    gap: 10px;
    overflow-y: auto;
    padding: 2px;
}

/* Custom scrollbar */
.servers-grid::-webkit-scrollbar {
    width: 4px;
}

.servers-grid::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.movies-mode .server-btn {
    background: rgba(255, 255, 255, 0.08);
    /* Slightly lighter */
    border: 1px solid transparent;
    /* No border by default */
    color: #ccc;
    border-radius: 6px;
    /* Soft rounding */
    font-weight: 500;
    padding: 10px 16px;
    /* Larger padding for touch */
    font-size: 13px;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-width: 80px;
    /* Ensure minimum click area */
}

.movies-mode .server-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.movies-mode .server-btn.active {
    background: var(--movies-primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.5);
    /* Stronger glow */
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Plyr Customization - Red Theme */
.movies-mode .plyr--video {
    --plyr-color-main: var(--movies-primary);
}

.movies-mode .plyr__control:hover {
    background: var(--movies-primary) !important;
}

.movies-mode .plyr__control--overlaid {
    background: rgba(229, 9, 20, 0.8) !important;
}

.movies-mode .plyr__control--overlaid:hover {
    background: var(--movies-primary) !important;
    transform: scale(1.1);
}

/* Branding in Player */
.movies-mode .plyr-branding {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 0 10px;
    color: #00ffa3;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.5px;
    opacity: 0.8;
    text-transform: uppercase;
}

/* Footer */
footer {
    margin-top: auto;
    width: 100%;
    max-width: 100%;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid var(--movies-glass-stroke);
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.movies-mode .footer-content p {
    color: rgba(255, 255, 255, 0.3);
}

/* Support Button */


.support-btn:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Info Alert */
.info-alert {
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid rgba(229, 9, 20, 0.3);
    color: #ffcccc;
    border-radius: 4px;
}

.refresh-hint {
    color: #fff;
    text-decoration: underline;
}

/* Accessibility Utilities */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 14px;
    width: 70%;
    margin-top: 8px;
    border-radius: 4px;
}

.skeleton-card {
    display: block;
    width: 100%;
    height: auto;
}

.skeleton-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    margin-bottom: 10px;
}


/* Mobile Optimizations */
@media (max-width: 600px) {
    .movies-mode header {
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--movies-glass-stroke);
    }

    .movies-mode .channels-hub {
        display: flex !important;
        flex-direction: column !important;
        background: transparent !important;
        max-height: 250px;
    }

    .movies-mode .app-container {
        padding: 15px 10px !important;
        width: 100% !important;
    }

    .movies-mode .channel-btn {
        background: rgba(255, 255, 255, 0.03) !important;
        margin-bottom: 5px;
    }

    /* Prevent any external sliding */
    .movies-slider {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Professional Centered Floating Modal - FINAL FIX */
    .movie-modal {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 5px !important;
        background: rgba(0, 0, 0, 0.9) !important;
        backdrop-filter: blur(10px) !important;
    }

    .modal-content-wrapper {
        width: 95% !important;
        max-width: 420px !important;
        max-height: 94vh !important;
        margin: auto !important;
        background: #0d0d0d !important;
        border-radius: 16px !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 1) !important;
        position: relative;
    }

    .player-container-modern {
        width: 100% !important;
        aspect-ratio: 16/9 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        background: #000;
        z-index: 5;
    }

    .modal-details {
        padding: 15px 20px !important;
        overflow-y: auto !important;
        flex: 1 !important;
        display: flex !important;
        text-align: right !important;
        background: #0d0d0d;
        z-index: 1;
    }

    .modal-title {
        font-size: 20px !important;
        font-weight: 800 !important;
        color: #fff !important;
        margin: 0 0 5px 0 !important;
        line-height: 1.2 !important;
    }

    .modal-meta {
        font-size: 13px !important;
        margin-bottom: 20px !important;
        color: rgba(255, 255, 255, 0.6) !important;
    }

    .modal-movie-description {
        font-size: 13px !important;
        line-height: 1.6 !important;
        color: #ddd !important;
        background: rgba(255, 255, 255, 0.04) !important;
        padding: 12px !important;
        margin-top: 10px !important;
        border-radius: 10px !important;
        border-right: 3px solid var(--movies-primary) !important;
    }

    .modal-section-title {
        display: flex;
        font-size: 14px !important;
        font-weight: 700 !important;
        text-align: right !important;
        color: #eee !important;
        align-content: center;
        justify-content: center;
    }

    .servers-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
        padding-bottom: 20px !important;
    }

    .movies-mode .server-btn {
        padding: 12px 5px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }

}

/* Category Sections */


.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    padding-right: 10px;
    border-right: 4px solid #E50914;
}


/* Horizontal Slider */
.slider-wrapper {
    position: relative;
    width: 100%;
}

.movies-slider {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 5px 10px 5px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 1;
}

.slider-nav-btn:hover {
    background: var(--movies-primary);
    border-color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.slider-nav-btn.prev {
    left: -20px;
}

.slider-nav-btn.next {
    right: -20px;
}

@media (max-width: 768px) {
    .slider-nav-btn {
        display: none;
        /* Hide on small mobile to avoid clutter */
    }
}

/* Base Modal Overlay - Fix for support/report modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #111;
    border-radius: 12px;
    padding: 25px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #333;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.movies-slider::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.movies-slider .movie-card {
    flex: 0 0 calc((100% - 135px) / 10);
    width: calc((100% - 135px) / 10);
}

@media (max-width: 600px) {
    .movies-slider .movie-card {
        flex: 0 0 100px;
        width: 100px;
    }
}

/* Hero Slider Specifics - Placed at end to override general sliders */


.hero-title {
    font-size: 22px;
    margin-bottom: 25px;
    border-right-width: 6px;
}

/* Hero Slider Specific Controls */
.hero-slider .movie-card {
    flex: 0 0 calc((100% - 60px) / 5) !important;
    width: calc((100% - 60px) / 5) !important;
    margin-bottom: 0 !important;
}

.hero-slider .movie-poster-wrapper {
    aspect-ratio: 10/9 !important;
    overflow: hidden !important;
}

/* Force Hero Overlay Visibility & Positioning */
.hero-card .hero-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    padding: 20px !important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 40%, transparent 80%) !important;
    pointer-events: none;
}

.hero-card .movie-poster {
    z-index: 1 !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slider .movie-title {
    font-size: 18px;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .hero-slider .movie-card {
        flex: 0 0 calc((100% - 15px) / 2) !important;
        /* 2 cards per row */
        width: calc((100% - 15px) / 2) !important;
    }
}

/* Premium Hero Card Enhancements */
.hero-slider .movie-card img {
    opacity: 1 !important;
    /* Full brightness for images */
}



.hero-title-text {
    font-size: 18px !important;
    font-weight: 800 !important;
    margin-bottom: 6px !important;
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    white-space: normal !important;
    line-height: 1.2 !important;
}

.hero-description {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    line-height: 1.4 !important;
    margin-bottom: 10px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 1 !important;
    line-clamp: 1 !important;
    /* Only 1 line of description */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    max-width: 90% !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.hero-play-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(229, 9, 20, 0.9);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    width: fit-content;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-card:hover .hero-play-tag {
    background: rgba(255, 255, 255, 0.95);
    color: var(--movies-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .hero-title-text {
        font-size: 14px !important;
    }

    .hero-description {
        font-size: 10px !important;
    }

    .hero-play-tag {
        font-size: 10px !important;
        padding: 4px 8px;
    }
}

/* Footer Quality Message */
.footer-quality-message {
    font-size: 14px;
    font-weight: 600;
    color: var(--movies-primary);
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

/* Footer Styles - Matching index.html */
footer {
    width: 100%;
    margin-top: auto;
    padding-top: 15px;
    padding-bottom: 15px;
    text-align: center;
    border-top: 1px solid var(--movies-glass-stroke);
    flex-shrink: 0;
}

.flag-icon {
    display: inline-block;
    width: 20px;
    height: auto;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 2px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.1));
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

/* Ramadan Section Styling - Enhanced */
.ramadan-section {
    position: relative;
    padding: 10px 20px;
    margin: 10px 0;
    /* Deep Red/Gold Night Theme */
    background: linear-gradient(135deg, #240b0b 0%, #1a0505 50%, #240b0b 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.05), inset 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Decorative Pattern Overlay */
.ramadan-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(255, 215, 0, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(255, 215, 0, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 90% 10%, rgba(255, 215, 0, 0.1) 1px, transparent 1px);
    background-size: 100px 100px;
    opacity: 0.6;
    pointer-events: none;
}

/* Golden Glow at Top */
.ramadan-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
    opacity: 0.7;
}

.ramadan-title {
    color: #FFD700 !important;
    /* Gold */
    text-shadow: 0 2px 15px rgba(255, 215, 0, 0.5);
    font-size: 22px !important;
    border-right: 4px solid #FFD700 !important;
    padding-right: 15px !important;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px !important;
    position: relative;
    z-index: 2;
}

.ramadan-icon {
    font-size: 24px;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-5px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.ramadan-wrapper .slider-nav-btn {
    background: rgba(255, 215, 0, 0.1);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.ramadan-wrapper .slider-nav-btn:hover {
    background: #FFD700;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* Pagination Styling */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--movies-primary);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: var(--movies-primary);
    border-color: var(--movies-primary);
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.pagination-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Coming Soon Placeholder */
.coming-soon-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.placeholder-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4);
    transform: scale(1.1);
}

.placeholder-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 20px;
}

.placeholder-icon {
    color: var(--movies-primary);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--movies-glow));
    animation: pulse-placeholder 2s infinite;
}

@keyframes pulse-placeholder {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.coming-soon-badge {
    display: inline-block;
    background: var(--movies-primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.placeholder-content h2 {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 10px;
}

.placeholder-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* Refined Note Sync */
.channel-note-wrapper {
    width: 100%;
    margin-top: 15px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 700;
}

.channel-note-wrapper svg {
    color: #ffc107;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .placeholder-content h2 {
        font-size: 20px;
    }

    .placeholder-content p {
        font-size: 12px;
    }
}

/* Coming Soon Placeholder inside Player Container */
.episode-coming-soon {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.episode-coming-soon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    opacity: 0.05;
}

.coming-soon-icon {
    color: #E50914;
    animation: placeholderPulse 2s infinite ease-in-out;
}

.episode-coming-soon h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #FFD700;
    /* Gold */
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.episode-coming-soon p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 80%;
}

@keyframes placeholderPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Playback Finished Screen - Ultra Professional */
.playback-finished-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 2000;
    /* Ensure it's above everything including controls */
    padding: 0;
    box-sizing: border-box;
}

.playback-finished-screen::-webkit-scrollbar {
    width: 4px;
}

.playback-finished-screen::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.finished-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.3);
    z-index: 1;
    transform: scale(1.1);
    animation: bgSlowZoom 20s infinite alternate ease-in-out;
}

@keyframes bgSlowZoom {
    from {
        transform: scale(1.1);
    }

    to {
        transform: scale(1.2);
    }
}

.finished-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
}

.finished-content {
    position: relative;
    z-index: 3;
    max-width: 500px;
    width: 90%;
    max-height: 95%;
    overflow-y: auto;
    padding: 15px 0;
    text-align: center;
    animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    scrollbar-width: none;
    /* Hide scrollbar for cleaner look */
}

.finished-content::-webkit-scrollbar {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.finished-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: inline-block;
    animation: bounceSlow 3s infinite ease-in-out;
}

@keyframes bounceSlow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.finished-title {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 6px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.finished-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
    font-weight: 500;
}

.recommendation-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    margin-bottom: 15px;
    text-align: right;
    direction: rtl;
    width: fit-content;
    max-width: 100%;
}

.recommendation-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
    border-color: var(--accent-neon);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 255, 163, 0.1);
}

.rec-poster-container {
    position: relative;
    width: 50px;
    height: 75px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.rec-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.recommendation-card:hover .rec-poster {
    transform: scale(1.1);
}

.rec-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: var(--accent-neon);
}

.recommendation-card:hover .rec-play-overlay {
    opacity: 1;
}

.rec-info {
    flex: 1;
}

.rec-label {
    font-size: 9px;
    color: var(--accent-neon);
    font-weight: 900;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
    opacity: 0.9;
}

.rec-name {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.rec-genre {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.rec-arrow {
    padding-left: 5px;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s, transform 0.3s;
}

.recommendation-card:hover .rec-arrow {
    color: var(--accent-neon);
    transform: translateX(-5px);
}

.finished-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-replay {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.4s;
}

.btn-replay:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.btn-close-modal {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-close-modal:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    color: #ff6b6b;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.1);
}

/* Playback Finished Screen - Micro Compact for Mobile */
@media (max-width: 600px) {
    .playback-finished-screen {
        z-index: 2147483647;
        /* Absolute top */
    }

    .finished-title {
        font-size: 13px;
        margin-bottom: 2px;
        padding: 0 10px;
    }

    .finished-subtitle {
        display: none;
        /* Hide subtitle on mobile to save space */
    }

    .finished-icon {
        display: none;
    }

    .recommendation-card {
        gap: 5px;
        padding: 4px 6px;
        margin-bottom: 8px;
        border-radius: 6px;
        max-width: 180px;
        /* Even smaller */
        margin-left: auto;
        margin-right: auto;
    }

    .rec-poster-container {
        width: 25px;
        height: 38px;
    }

    .rec-name {
        font-size: 10px;
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rec-label {
        font-size: 6px;
    }

    .rec-genre {
        font-size: 8px;
    }

    .btn-replay {
        padding: 4px 10px;
        font-size: 9px;
        border-radius: 5px;
    }

    .finished-content {
        max-height: 100%;
        width: 100%;
        padding: 5px;
        overflow: hidden;
        transform: scale(0.95);
        /* Subtle shrink for extra safety */
    }

    .finished-actions {
        gap: 5px;
    }
}

@media (max-height: 480px) {
    .playback-finished-screen {
        padding: 0;
    }

    .finished-title {
        font-size: 11px;
        margin-bottom: 1px;
    }

    .recommendation-card {
        margin-bottom: 5px;
        padding: 3px 5px;
        max-width: 160px;
    }

    .rec-poster-container {
        width: 22px;
        height: 32px;
    }

    .rec-name {
        font-size: 9px;
    }

    .btn-replay {
        padding: 3px 8px;
        font-size: 8px;
    }
}


