/* ============================================
   MoviesHub - Complete Stylesheet
   Netflix-style Design with Video Player
   ============================================ */

/* ----- Reset & Base ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #e50914;
    --primary-hover: #f40612;
    --bg-primary: #141414;
    --bg-secondary: #1a1a2e;
    --bg-card: #2a2a2a;
    --bg-hover: #404040;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #737373;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    --transition: all 0.3s ease;
    --border-color: rgba(255, 255, 255, 0.05);
    --header-bg: rgba(20, 20, 20, 0.95);
    --header-scrolled: #141414;
}

[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-card: #e8e8e8;
    --bg-hover: #d4d4d4;
    --text-primary: #1a1a2e;
    --text-secondary: #555555;
    --text-muted: #888888;
    --border-color: rgba(0, 0, 0, 0.05);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-scrolled: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ----- Header / Navigation ----- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 4%;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.header.scrolled {
    background: var(--header-scrolled);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1440px;
    margin: 0 auto;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo i {
    font-size: 28px;
}

/* Light mode logo fix */
[data-theme="light"] .logo {
    color: #1a1a2e;
}

[data-theme="light"] .logo span:last-child {
    color: var(--primary);
}

/* ----- Mobile Menu Toggle ----- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

[data-theme="light"] .nav-links a {
    color: #555;
}

[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active {
    color: #1a1a2e;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* ----- Header Actions ----- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

[data-theme="light"] .search-container {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.search-container:focus-within {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .search-container:focus-within {
    background: rgba(0, 0, 0, 0.08);
}

.search-input {
    background: none;
    border: none;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 14px;
    width: 200px;
    outline: none;
}

[data-theme="light"] .search-input {
    color: #1a1a2e;
}

.search-input::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .search-input::placeholder {
    color: #888;
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    color: var(--text-primary);
}

[data-theme="light"] .search-btn {
    color: #555;
}

[data-theme="light"] .search-btn:hover {
    color: #1a1a2e;
}

/* ----- Theme Toggle ----- */
.theme-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
    border-radius: 50%;
}

.theme-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .theme-btn {
    color: #555;
}

[data-theme="light"] .theme-btn:hover {
    color: #1a1a2e;
    background: rgba(0, 0, 0, 0.05);
}

/* ----- Hero Banner ----- */
.hero {
    margin-top: 68px;
    padding: 80px 4%;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-bottom: 1px solid var(--border-color);
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    gap: 40px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(229, 9, 20, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 1;
    flex: 1;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

.hero-btn {
    padding: 12px 32px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.hero-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* ----- Hero Image ----- */
.hero-image {
    flex: 1;
    max-width: 500px;
    position: relative;
    z-index: 1;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 16/9;
    background: var(--bg-secondary);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    color: var(--text-muted);
    font-size: 48px;
}

.hero-image .movie-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
}

.hero-image .movie-title-overlay h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.hero-image .movie-title-overlay p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ----- Movies Section ----- */
.movies-section {
    padding: 40px 4% 60px;
    max-width: 1440px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.view-toggle {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.view-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.view-btn:hover,
.view-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ----- Filters ----- */
.filter-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.filter-select {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-select:hover {
    border-color: var(--primary);
}

/* ----- Movies Grid ----- */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Movie Card Animation */
.movie-card {
    opacity: 0;
    animation: cardFadeIn 0.5s ease forwards;
}

.movie-card:nth-child(1) { animation-delay: 0.05s; }
.movie-card:nth-child(2) { animation-delay: 0.10s; }
.movie-card:nth-child(3) { animation-delay: 0.15s; }
.movie-card:nth-child(4) { animation-delay: 0.20s; }
.movie-card:nth-child(5) { animation-delay: 0.25s; }
.movie-card:nth-child(6) { animation-delay: 0.30s; }
.movie-card:nth-child(7) { animation-delay: 0.35s; }
.movie-card:nth-child(8) { animation-delay: 0.40s; }
.movie-card:nth-child(9) { animation-delay: 0.45s; }
.movie-card:nth-child(10) { animation-delay: 0.50s; }
.movie-card:nth-child(11) { animation-delay: 0.55s; }
.movie-card:nth-child(12) { animation-delay: 0.60s; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Grid View */
.movies-grid.grid-view .movie-card {
    transition: var(--transition);
}

.movies-grid.grid-view .movie-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* List View */
.movies-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.movies-grid.list-view .movie-card {
    display: flex;
    gap: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    align-items: flex-start;
}

.movies-grid.list-view .movie-card .poster-wrapper {
    width: 120px;
    height: 180px;
    flex-shrink: 0;
    padding-bottom: 0;
}

.movies-grid.list-view .movie-card .poster-wrapper img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movies-grid.list-view .movie-card .movie-info {
    flex: 1;
}

.movies-grid.list-view .movie-card .movie-title {
    font-size: 20px;
}

.movies-grid.list-view .movie-card .movie-overview-text {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movies-grid.list-view .movie-card .movie-overlay {
    display: none;
}

.movies-grid.grid-view .movie-card .movie-overview-text {
    display: none;
}

/* ----- Movie Card ----- */
.movie-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.movie-card:hover {
    box-shadow: var(--shadow);
}

.poster-wrapper {
    position: relative;
    padding-bottom: 150%;
    overflow: hidden;
    background: var(--bg-card);
}

.poster-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.movie-card:hover .poster-wrapper img {
    transform: scale(1.05);
}

/* Trending Badge */
.trending-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trending-badge i {
    font-size: 10px;
}

.movie-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #f5c518;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.movie-rating i {
    font-size: 10px;
}

.movie-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 16px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition);
}

.movie-card:hover .movie-overlay {
    opacity: 1;
}

.movie-overview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.movie-info {
    padding: 12px 16px 16px;
}

.movie-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.movie-year {
    color: var(--text-muted);
}

/* ----- Buttons ----- */
.watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 4px;
}

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

.watch-btn i {
    font-size: 10px;
}

.watchlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.watchlist-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.trailer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 0, 0, 0.8);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.trailer-btn:hover {
    background: #ff0000;
    transform: scale(1.05);
}

.trailer-btn i {
    font-size: 14px;
}

/* ----- Load More ----- */
.load-more-container {
    text-align: center;
}

.load-more-btn {
    padding: 12px 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.load-more-btn .btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.load-more-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.load-more-btn.loading .btn-text {
    display: none;
}

.load-more-btn.loading .btn-loader {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.load-more-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ----- Loading Skeletons ----- */
.skeleton-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-poster {
    padding-bottom: 150%;
    width: 100%;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-title {
    height: 18px;
    width: 80%;
    margin: 8px 0;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-meta {
    height: 12px;
    width: 60%;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

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

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ----- Loading Spinner ----- */
.loading-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    grid-column: 1/-1;
    width: 100%;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 14px;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ----- No Results ----- */
.no-results {
    grid-column: 1/-1;
    text-align: center;
    padding: 80px 20px;
    animation: noResultsPulse 2s ease-in-out infinite;
}

.no-results i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: block;
}

.no-results h3 {
    color: var(--text-secondary);
    font-size: 24px;
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-muted);
    font-size: 16px;
}

@keyframes noResultsPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ----- Modals ----- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    max-width: 900px;
    margin: 40px auto;
    background: var(--bg-secondary);
    border-radius: 16px;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: sticky;
    top: 0;
    float: right;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 16px 24px;
    transition: var(--transition);
    z-index: 10;
    background: transparent;
}

.modal-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0 32px 32px;
}

.modal-poster {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-size: 32px;
    font-weight: 700;
    margin: 20px 0 8px;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-overview {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.modal-detail-item {
    color: var(--text-secondary);
    font-size: 14px;
}

.modal-detail-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.modal-detail-item .genre-tag {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(229, 9, 20, 0.2);
    border-radius: 20px;
    color: var(--primary);
    font-size: 12px;
    margin: 2px;
}

/* ----- Cast Section ----- */
.cast-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.cast-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.cast-item {
    text-align: center;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.cast-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.cast-item img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.cast-name {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 4px 2px;
}

.cast-character {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 0 4px 6px;
}

/* ----- Reviews Section ----- */
.reviews-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.reviews-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.review-input {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.rating-input {
    margin-bottom: 8px;
    display: flex;
    gap: 4px;
}

.star {
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: var(--transition);
    user-select: none;
}

.star:hover {
    transform: scale(1.2);
}

.review-input textarea {
    width: 100%;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    margin-bottom: 8px;
}

.review-input textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.submit-review-btn {
    padding: 8px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.submit-review-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.review-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.review-user {
    font-weight: 600;
    font-size: 14px;
}

.review-rating {
    font-size: 14px;
}

.review-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.review-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ----- Video Player Modal ----- */
.player-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.player-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #1a1a2e;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.player-header h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 28px;
    cursor: pointer;
    padding: 0 8px;
    transition: color 0.3s ease;
    line-height: 1;
}

.player-close:hover {
    color: #fff;
}

.player-wrapper {
    flex: 1;
    position: relative;
    background: #000;
    min-height: 0;
}

.player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    z-index: 10;
}

.player-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.player-controls {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    background: #1a1a2e;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.player-controls button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-controls button:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ----- Trailer Modal ----- */
.trailer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.trailer-modal.active {
    display: flex;
}

.trailer-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.trailer-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.trailer-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    z-index: 10;
    transition: var(--transition);
}

.trailer-close:hover {
    background: var(--primary);
}

/* ----- Back to Top ----- */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 100;
}

.back-to-top:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    animation: fadeInUp 0.3s ease;
}

.back-to-top:not(.visible) {
    opacity: 0;
    visibility: hidden;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Mobile Bottom Navigation ----- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 8px 0 env(safe-area-inset-bottom);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(8px);
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    padding: 4px 12px;
    gap: 2px;
    transition: var(--transition);
    position: relative;
}

.mobile-bottom-nav a i {
    font-size: 20px;
}

.mobile-bottom-nav a.active {
    color: var(--primary);
}

.mobile-bottom-nav a:hover {
    color: var(--text-primary);
}

/* ----- Toast Notifications ----- */
.toast-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.toast {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    color: var(--text-primary);
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.toast.success {
    border-left-color: #46d369;
}

.toast.error {
    border-left-color: var(--primary);
}

.toast.info {
    border-left-color: #0071eb;
}

.toast.warning {
    border-left-color: #f5a623;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ----- Social Popup ----- */
.social-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: popupFadeIn 0.3s ease;
    backdrop-filter: blur(8px);
    padding: 20px;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.social-popup-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 40px 50px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    animation: popupBounce 0.5s ease;
}

@keyframes popupBounce {
    0% { transform: scale(0.5); }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.social-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    padding: 4px 8px;
}

.social-popup-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.social-popup-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.social-popup-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #e50914;
}

.social-popup-content p {
    font-size: 16px;
    color: #ffffff;
    line-height: 1.6;
}

/* ----- Footer ----- */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 4% 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 32px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 12px;
    font-size: 16px;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    padding: 4px 0;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--text-primary);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
}

.footer-bottom .brand {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ----- Touch Feedback (Mobile) ----- */
@media (pointer: coarse) {
    .movie-card:active {
        transform: scale(0.97) !important;
    }

    .watch-btn:active,
    .hero-btn:active,
    .trailer-btn:active {
        transform: scale(0.95) !important;
    }

    .mobile-bottom-nav a:active {
        transform: scale(0.9);
    }

    .nav-links a {
        padding: 8px 12px;
    }

    .search-container {
        padding: 6px;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ----- Responsive ----- */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 60px 4%;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-image {
        max-width: 100%;
        width: 100%;
        max-height: 300px;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 10px 4%;
    }

    .nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        padding: 16px 20px;
        flex-direction: column;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 10px 0;
        font-size: 16px;
        width: 100%;
        text-align: center;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-actions {
        flex: 1;
        justify-content: flex-end;
    }

    .search-container {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .hero {
        padding: 40px 4%;
        min-height: auto;
        gap: 20px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-content p {
        font-size: 14px;
    }

    .hero-image {
        max-height: 200px;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .movies-grid.list-view .movie-card {
        flex-direction: column;
        padding: 12px;
        align-items: center;
        text-align: center;
    }

    .movies-grid.list-view .movie-card .poster-wrapper {
        width: 100%;
        max-width: 200px;
        height: auto;
        margin: 0 auto;
    }

    .movies-grid.list-view .movie-card .movie-title {
        font-size: 18px;
    }

    .movies-grid.list-view .movie-card .movie-overview-text {
        -webkit-line-clamp: 2;
        font-size: 13px;
    }

    .filter-container {
        width: 100%;
    }

    .filter-select {
        flex: 1;
        min-width: 80px;
        font-size: 12px;
        padding: 4px 8px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-header h2 {
        font-size: 20px;
    }

    .view-toggle {
        justify-content: flex-end;
    }

    .modal-content {
        margin: 20px auto;
    }

    .modal-title {
        font-size: 24px;
    }

    .modal-body {
        padding: 0 16px 16px;
    }

    .modal-poster {
        max-height: 200px;
    }

    .modal-details {
        grid-template-columns: 1fr 1fr;
    }

    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }

    .cast-name {
        font-size: 11px;
    }

    .cast-character {
        font-size: 10px;
    }

    .review-header {
        gap: 8px;
    }

    .player-container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .player-header h3 {
        font-size: 14px;
        max-width: 200px;
    }

    .player-controls button {
        padding: 6px 12px;
        font-size: 12px;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .movies-section {
        padding-bottom: 80px;
    }

    .footer {
        padding-bottom: 80px;
    }

    .toast-container {
        bottom: 90px;
        left: 20px;
        right: 20px;
        max-width: 100%;
    }

    .social-popup-content {
        padding: 30px 24px;
    }

    .social-popup-icon {
        font-size: 48px;
    }

    .social-popup-content h2 {
        font-size: 26px;
    }

    .back-to-top {
        bottom: 80px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 18px;
    }

    .logo i {
        font-size: 20px;
    }

    .hero-content h1 {
        font-size: 22px;
    }

    .hero-image {
        max-height: 160px;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .movie-title {
        font-size: 13px;
    }

    .movie-meta {
        font-size: 11px;
    }

    .movie-rating {
        font-size: 10px;
        padding: 2px 6px;
    }

    .watch-btn,
    .trailer-btn {
        font-size: 10px;
        padding: 4px 10px;
    }

    .mobile-bottom-nav a {
        font-size: 9px;
        padding: 4px 8px;
    }

    .mobile-bottom-nav a i {
        font-size: 18px;
    }

    .player-header h3 {
        max-width: 120px;
        font-size: 12px;
    }

    .player-controls {
        padding: 8px 12px;
        gap: 6px;
    }

    .player-controls button {
        font-size: 11px;
        padding: 4px 10px;
    }

    .filter-select {
        font-size: 11px;
        padding: 3px 6px;
        min-width: 70px;
    }

    .modal-title {
        font-size: 20px;
    }

    .modal-meta {
        font-size: 12px;
        gap: 10px;
    }

    .modal-details {
        grid-template-columns: 1fr;
    }
}

/* ----- Utility ----- */
.text-center {
    text-align: center;
}
.mt-20 {
    margin-top: 20px;
}
.mb-20 {
    margin-bottom: 20px;
}
.hidden {
    display: none !important;
}

/* ----- Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
