/* ===================================
   MovieStream - Modern Movie Site CSS
   =================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e50914;
    --secondary-color: #0f79af;
    --bg-dark: #0a0a0a;
    --bg-dark-lighter: #141414;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --border-color: #2a2a2a;
    --rating-high: #46d369;
    --rating-medium: #ffb31a;
    --rating-low: #ff4757;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.9), transparent);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.98);
    box-shadow: var(--shadow-md);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-brand i {
    font-size: 1.8rem;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 25px;
}

.navbar-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--text-primary);
}

.navbar-search {
    margin-left: auto;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 8px 15px;
    transition: var(--transition);
}

.search-form:focus-within {
    border-color: var(--primary-color);
}

.search-form input {
    background: none;
    border: none;
    color: var(--text-primary);
    outline: none;
    padding: 0 10px;
    width: 250px;
}

.search-form button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.search-form button:hover {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    padding-top: 70px;
    min-height: 100vh;
}

/* Hero Section */
.hero {
    height: 80vh;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.hero-content {
    max-width: 600px;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1rem;
}

.hero-meta .rating {
    color: var(--rating-high);
}

.hero-overview {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.8);
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #b20710;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sections */
.section {
    padding: 40px 0;
}

.section-dark {
    background: var(--bg-dark-lighter);
    padding: 60px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.see-all {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.see-all:hover {
    color: var(--primary-color);
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.media-card {
    transition: var(--transition);
}

.media-card:hover {
    transform: translateY(-5px);
}

.media-poster {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    aspect-ratio: 2/3;
}

.media-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.media-overlay i {
    font-size: 3rem;
    color: white;
}

.media-card:hover .media-overlay {
    opacity: 1;
}

.media-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}

.media-quality {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.media-quality .quality-badge {
    padding: 4px 8px;
    font-size: 0.7rem;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.rating-high {
    color: var(--rating-high);
}

.rating-medium {
    color: var(--rating-medium);
}

.rating-low {
    color: var(--rating-low);
}

.media-info {
    padding: 10px 0;
}

.media-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.media-type {
    background: var(--border-color);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
}

/* Detail Page */
.detail-page {
    position: relative;
}

.detail-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 600px;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.detail-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-dark) 0%, transparent 50%, rgba(10, 10, 10, 0.8) 100%);
}

.detail-content {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 40px;
    padding: 100px 0 60px;
}

.detail-poster {
    flex-shrink: 0;
}

.detail-poster img {
    width: 300px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

.detail-info {
    flex: 1;
}

.detail-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.detail-tagline {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.rating-badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.badge-adult,
.badge-pg,
.badge-status {
    padding: 5px 12px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.85rem;
}

.view-count-badge {
    padding: 5px 12px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(99, 102, 241, 0.2);
    color: var(--admin-primary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-adult {
    background: var(--rating-low);
}

.badge-pg {
    background: var(--rating-medium);
}

.badge-status {
    background: var(--secondary-color);
}

.detail-genres {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.genre-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.genre-tag:hover {
    background: var(--primary-color);
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.quality-badge-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quality-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.quality-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quality-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quality-badge.quality-1080p {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.quality-badge.quality-720p {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.quality-badge.quality-dvd {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.quality-badge.quality-cam {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #333;
}

.quality-badge.quality-ts,
.quality-badge.quality-tc {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

.quality-badge.quality-webrip {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.quality-badge.quality-bluray {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

.detail-overview h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.detail-overview p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.detail-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
}

.fact {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fact strong {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Cast Grid */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
}

.cast-card {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    transition: var(--transition);
    text-align: center;
}

.cast-card:hover {
    transform: translateY(-5px);
}

.cast-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 10px;
    border: 3px solid var(--border-color);
    transition: var(--transition);
}

.cast-card:hover img {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.cast-info {
    padding: 0;
}

.cast-info h4 {
    font-size: 0.85rem;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-primary);
}

.cast-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Seasons Toggle */
.seasons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.season-toggle-container {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.season-toggle-container:hover {
    border-color: var(--primary-color);
}

.season-toggle-btn {
    width: 100%;
    background: transparent;
    color: var(--text-primary);
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.season-toggle-btn:hover,
.season-toggle-btn.active {
    background: rgba(229, 9, 20, 0.1);
}

.season-toggle-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.season-toggle-title i {
    font-size: 0.9rem;
    transition: var(--transition);
    color: var(--primary-color);
}

.episode-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 400;
    margin-left: 10px;
}

.season-year {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

.season-episodes {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.season-episodes.expanded {
    max-height: 10000px;
    transition: max-height 0.5s ease-in;
}

.season-episodes .episodes-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.season-episodes .episodes-loading i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Spinner animation */
.fa-spin {
    animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.episode-card {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.episode-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.episode-image {
    position: relative;
    width: 300px;
    flex-shrink: 0;
}

.episode-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(229, 9, 20, 0.9);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.episode-card:hover .episode-play {
    opacity: 1;
}

.episode-play:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.episode-info {
    flex: 1;
    padding: 20px;
}

.episode-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.episode-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.episode-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--rating-high);
}

.episode-meta {
    display: flex;
    gap: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.episode-overview {
    color: var(--text-secondary);
    line-height: 1.6;
}

.no-episodes {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.no-episodes i {
    display: block;
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-episodes .btn {
    margin-top: 15px;
    display: inline-block;
}

/* Player Section */
.player-section {
    background: var(--bg-dark-lighter);
    padding: 0;
    margin: 60px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.player-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid var(--primary-color);
}

.player-header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.player-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-quality-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(229, 9, 20, 0.2);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-close-player,
.btn-download-player {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn-close-player:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.btn-download-player {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.btn-download-player:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-download-player:active,
.btn-close-player:active {
    transform: translateY(0);
}

.player-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    width: 100%;
}

.player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 1024px) {
    .player-container {
        max-width: 95%;
    }
}

/* Mobile-specific player styles */
@media (max-width: 768px) {
    .player-section {
        margin: 30px 0;
        border-radius: 8px;
    }
    
    .player-container {
        max-width: 100%;
    }
    
    .player-header {
        padding: 15px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .player-header-left {
        width: 100%;
    }
    
    .player-header-right {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .player-header h2 {
        font-size: 1.2rem;
    }
    
    .btn-close-player,
    .btn-download-player {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .player-wrapper {
        padding-bottom: 56.25%; /* Maintain 16:9 aspect ratio */
    }
    
    .player-wrapper iframe {
        min-height: unset !important; /* Override inline styles */
    }
}

@media (max-width: 576px) {
    .player-section {
        margin: 20px 0;
        border-radius: 6px;
    }
    
    .player-header {
        padding: 12px;
        gap: 10px;
    }
    
    .player-header h2 {
        font-size: 1rem;
        gap: 8px;
    }
    
    .player-header h2 i {
        font-size: 1rem;
    }
    
    .player-header-right {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-close-player,
    .btn-download-player {
        width: 100%;
        min-width: 100%;
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .player-wrapper {
        padding-bottom: 56.25%;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .player-section {
        margin: 15px 0;
    }
    
    .player-header {
        padding: 10px 15px;
    }
    
    .player-header h2 {
        font-size: 0.95rem;
    }
    
    .btn-close-player,
    .btn-download-player {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Custom Episode Input - Modern Glassmorphism Design */
.custom-episode-input {
    position: relative;
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.custom-episode-input::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(229, 9, 20, 0.1), transparent);
    transition: left 0.5s ease;
}

.custom-episode-input:hover::before {
    left: 100%;
}

.custom-episode-input:hover {
    border-color: rgba(229, 9, 20, 0.5);
    box-shadow: 
        0 12px 40px rgba(229, 9, 20, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
}

.custom-episode-input h3 {
    color: #fff;
    margin: 0 0 24px 0;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.custom-episode-input h3 i {
    color: #e50914;
    font-size: 1.4rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.custom-input-group {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    position: relative;
    z-index: 1;
}

.input-wrapper {
    flex: 1;
    min-width: 0;
    max-width: 180px;
    position: relative;
}

.input-wrapper label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 0.85rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.9;
}

.input-wrapper label i {
    color: #e50914;
    font-size: 0.9rem;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.input-wrapper input:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.input-wrapper input:focus {
    outline: none;
    border-color: #e50914;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 
        0 0 0 4px rgba(229, 9, 20, 0.2),
        inset 0 2px 8px rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

/* Number input arrows styling */
.input-wrapper input::-webkit-inner-spin-button,
.input-wrapper input::-webkit-outer-spin-button {
    opacity: 1;
    height: 40px;
}

.custom-episode-input .btn {
    padding: 16px 36px;
    height: auto;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 16px;
    background: linear-gradient(135deg, #e50914 0%, #ff0a16 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 24px rgba(229, 9, 20, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.custom-episode-input .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.custom-episode-input .btn:hover::before {
    width: 300px;
    height: 300px;
}

.custom-episode-input .btn:hover {
    background: linear-gradient(135deg, #ff0a16 0%, #ff3d47 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(229, 9, 20, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.custom-episode-input .btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 4px 16px rgba(229, 9, 20, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.custom-episode-input .btn i {
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

.custom-episode-input .btn span {
    position: relative;
    z-index: 1;
}

/* Loading state for input */
.input-wrapper input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Glow effect on focus */
.input-wrapper input:focus + .input-glow {
    opacity: 1;
}

.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(229, 9, 20, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 16px;
}

/* Responsive Design for Custom Episode Input */
@media (max-width: 992px) {
    .custom-episode-input {
        padding: 25px;
    }
    
    .custom-episode-input h3 {
        font-size: 1.2rem;
    }
    
    .input-wrapper {
        max-width: 160px;
    }
    
    .custom-input-group {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .custom-episode-input {
        padding: 20px;
        border-radius: 20px;
    }
    
    .custom-episode-input h3 {
        font-size: 1.1rem;
        margin-bottom: 20px;
        gap: 10px;
    }
    
    .custom-episode-input h3 i {
        font-size: 1.2rem;
    }
    
    .custom-input-group {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .input-wrapper {
        max-width: 140px;
    }
    
    .input-wrapper label {
        font-size: 0.75rem;
        margin-bottom: 8px;
        letter-spacing: 1px;
    }
    
    .input-wrapper input {
        padding: 14px 16px;
        font-size: 1.2rem;
    }
    
    .custom-episode-input .btn {
        padding: 14px 28px;
        font-size: 1rem;
        gap: 8px;
    }
    
    .custom-episode-input .btn i {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .custom-episode-input {
        padding: 18px;
        border-radius: 18px;
        margin-bottom: 1.5rem;
    }
    
    .custom-episode-input h3 {
        font-size: 1rem;
        margin-bottom: 16px;
        gap: 8px;
        letter-spacing: 0.5px;
    }
    
    .custom-episode-input h3 i {
        font-size: 1.1rem;
    }
    
    .custom-input-group {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .input-wrapper {
        max-width: 100%;
        width: 100%;
    }
    
    .input-wrapper label {
        font-size: 0.7rem;
        margin-bottom: 6px;
        justify-content: center;
    }
    
    .input-wrapper input {
        padding: 14px;
        font-size: 1.3rem;
        border-radius: 14px;
    }
    
    .custom-episode-input .btn {
        width: 100%;
        padding: 16px;
        font-size: 1rem;
        border-radius: 14px;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .custom-episode-input {
        padding: 15px;
        border-radius: 16px;
    }
    
    .custom-episode-input h3 {
        font-size: 0.95rem;
        margin-bottom: 14px;
    }
    
    .input-wrapper label {
        font-size: 0.65rem;
    }
    
    .input-wrapper input {
        padding: 12px;
        font-size: 1.2rem;
    }
    
    .custom-episode-input .btn {
        padding: 14px;
        font-size: 0.95rem;
        letter-spacing: 0.5px;
    }
}

/* Landscape orientation on small screens */
@media (max-width: 768px) and (orientation: landscape) {
    .custom-episode-input {
        padding: 15px 20px;
    }
    
    .custom-input-group {
        flex-direction: row;
        gap: 10px;
    }
    
    .input-wrapper {
        max-width: 120px;
    }
    
    .input-wrapper label {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }
    
    .input-wrapper input {
        padding: 10px;
        font-size: 1.1rem;
    }
    
    .custom-episode-input .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .custom-episode-input h3 {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .custom-episode-input {
        border-width: 0.5px;
    }
    
    .input-wrapper input {
        border-width: 1.5px;
    }
}

/* Tablet landscape - optimize for wider but shorter screens */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .custom-episode-input {
        padding: 25px 30px;
    }
    
    .custom-input-group {
        gap: 18px;
    }
    
    .input-wrapper {
        max-width: 170px;
    }
}

/* Large desktop optimization */
@media (min-width: 1400px) {
    .custom-episode-input {
        padding: 35px;
        border-radius: 28px;
    }
    
    .custom-episode-input h3 {
        font-size: 1.4rem;
        margin-bottom: 28px;
    }
    
    .custom-input-group {
        gap: 24px;
    }
    
    .input-wrapper {
        max-width: 200px;
    }
    
    .input-wrapper input {
        padding: 18px 22px;
        font-size: 1.4rem;
    }
    
    .custom-episode-input .btn {
        padding: 18px 40px;
        font-size: 1.1rem;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .custom-episode-input,
    .custom-episode-input::before,
    .input-wrapper input,
    .custom-episode-input .btn,
    .custom-episode-input .btn::before,
    .custom-episode-input h3 i {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark mode enhancement */
@media (prefers-color-scheme: dark) {
    .custom-episode-input {
        background: rgba(15, 15, 15, 0.8);
    }
    
    .input-wrapper input {
        background: rgba(0, 0, 0, 0.7);
    }
}

/* Touch-friendly optimization for mobile devices */
@media (hover: none) and (pointer: coarse) {
    .input-wrapper input {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* iOS recommended touch target */
    }
    
    .custom-episode-input .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .custom-episode-input:hover {
        transform: none; /* Disable hover effects on touch devices */
    }
}

/* Download Modal */
.download-modal {
    display: block;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.download-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    margin: 5% auto;
    padding: 0;
    border: 2px solid rgba(229, 9, 20, 0.3);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.download-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: rgba(229, 9, 20, 0.1);
    border-bottom: 2px solid rgba(229, 9, 20, 0.3);
    border-radius: 14px 14px 0 0;
}

.download-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.download-modal-header h3 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.download-modal-close {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.download-modal-close:hover {
    background: var(--primary-color);
    transform: rotate(90deg);
}

.download-modal-body {
    padding: 30px;
}

.download-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 25px;
    text-align: center;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.download-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.download-option:hover {
    background: rgba(229, 9, 20, 0.1);
    border-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.2);
}

.download-option i {
    font-size: 2rem;
    color: var(--primary-color);
    width: 40px;
    text-align: center;
}

.download-option span {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.download-option span small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.download-notice {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.download-notice i {
    color: #4CAF50;
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.download-notice p {
    margin: 0;
    font-size: 0.9rem;
}

/* Download Modal Responsive */
@media (max-width: 768px) {
    .download-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .download-modal-header {
        padding: 20px;
    }
    
    .download-modal-header h3 {
        font-size: 1.2rem;
    }
    
    .download-modal-body {
        padding: 20px;
    }
    
    .download-title {
        font-size: 1.1rem;
    }
    
    .download-option {
        padding: 15px;
        gap: 12px;
    }
    
    .download-option i {
        font-size: 1.5rem;
        width: 30px;
    }
    
    .download-notice {
        padding: 15px;
        gap: 12px;
    }
    
    .download-notice i {
        font-size: 1.2rem;
    }
}

/* Modal (keep for backwards compatibility if needed) */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    background: var(--bg-dark);
    border-radius: 10px;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--primary-color);
}

/* Browse & Search Pages */
.browse-page,
.search-page {
    padding: 40px 0;
}

.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.filter-buttons,
.type-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.filter-btn,
.type-btn {
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover,
.type-btn:hover,
.filter-btn.active,
.type-btn.active {
    background: var(--primary-color);
    color: white;
}

.search-form-large {
    display: flex;
    gap: 10px;
    max-width: 800px;
    margin: 30px 0;
}

.search-form-large input {
    flex: 1;
    padding: 15px 25px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 1rem;
}

.search-form-large input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-form-large button {
    padding: 15px 35px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-form-large button:hover {
    background: #b20710;
}

.filter-tabs {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    border-bottom: 2px solid var(--border-color);
}

.filter-tab {
    padding: 12px 24px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.filter-tab:hover,
.filter-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-color);
}

.result-count {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.9rem;
}

.genre-filter {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 40px;
}

.genre-filter h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.genre-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.genre-chip {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.genre-chip:hover,
.genre-chip.active {
    background: var(--primary-color);
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px 0;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-number {
    padding: 10px 15px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 5px;
    font-weight: 500;
    transition: var(--transition);
}

.pagination-btn:hover,
.pagination-number:hover,
.pagination-number.active {
    background: var(--primary-color);
    color: white;
}

.pagination-dots {
    color: var(--text-muted);
    padding: 0 5px;
}

/* Footer */
.footer {
    background: var(--bg-dark-lighter);
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-section ul a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer-disclaimer {
    margin-top: 10px;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .detail-poster img {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }
    
    .navbar-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        padding: 20px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    
    .navbar-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .navbar-search {
        margin-left: 0;
        width: 100%;
    }
    
    .search-form {
        width: 100%;
    }
    
    .search-form input {
        width: 100%;
    }
    
    .hero {
        height: 60vh;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .detail-content {
        flex-direction: column;
        padding-top: 80px;
    }
    
    .detail-poster img {
        width: 200px;
        margin: 0 auto;
    }
    
    .detail-title {
        font-size: 2rem;
    }
    
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 15px;
    }
    
    .cast-card img {
        width: 60px;
        height: 60px;
    }
    
    .cast-info h4 {
        font-size: 0.75rem;
    }
    
    .cast-info p {
        font-size: 0.7rem;
    }
    
    .episode-card {
        flex-direction: column;
    }
    
    .episode-image {
        width: 100%;
        height: 200px;
    }
    
    .search-form-large {
        flex-direction: column;
    }
    
    .season-toggle-btn {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .season-toggle-title {
        font-size: 1rem;
    }
    
    .episodes-list {
        padding: 15px;
    }
    
    .player-container {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .quality-badge-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

