* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    line-height: 1.6;
}


/* Navigation */

.navbar {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.5rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e50914;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-search {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    position: relative;
}

.search-form {
    display: flex;
    background: #333;
    border-radius: 25px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: #999;
}

.search-input:focus {
    outline: none;
}

.search-btn {
    background: #e50914;
    border: none;
    padding: 0.75rem 1rem;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background: #b8070f;
}


/* Autocomplete Dropdown */

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    max-height: 400px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: #333;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #2a2a2a;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: #333;
}

.autocomplete-poster {
    width: 40px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.autocomplete-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.autocomplete-poster-placeholder {
    color: #666;
    font-size: 1.2rem;
}

.autocomplete-info {
    flex: 1;
    min-width: 0;
}

.autocomplete-title {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.autocomplete-year {
    color: #999;
    font-size: 0.8rem;
}

.autocomplete-type {
    background: #e50914;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

.autocomplete-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    color: #ffd700;
    font-size: 0.8rem;
}

.autocomplete-overview {
    color: #ccc;
    font-size: 0.75rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.autocomplete-actions {
    margin-left: auto;
    padding-left: 12px;
}

.autocomplete-details-btn {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.autocomplete-details-btn:hover {
    border-color: #e50914;
    color: #e50914;
    background: rgba(229, 9, 20, 0.1);
}

.autocomplete-no-results {
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.autocomplete-loading {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-top: 2px solid #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #e50914;
}


/* Main Content */

.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 140px);
}


/* Hero Section */

.hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b69 100%);
    padding: 4rem 1rem;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #e50914, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #cccccc;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.hero-search-form {
    display: flex;
    background: #333;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 1rem;
}

.hero-search-input::placeholder {
    color: #999;
}

.hero-search-btn {
    background: #e50914;
    border: none;
    padding: 1rem 2rem;
    color: #ffffff;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.hero-search-btn:hover {
    background: #b8070f;
}


/* Hero search autocomplete styling */

.hero-search .autocomplete-dropdown {
    border-radius: 16px;
    margin-top: 12px;
}


/* Content Sections */

.content-sections {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.content-sections h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-sections h2 i {
    color: #e50914;
}


/* Media Grid */

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.media-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.3);
}

.media-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.media-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-poster {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #333, #555);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #999;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(229, 9, 20, 0.9);
    color: #ffffff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.media-card:hover .play-overlay {
    opacity: 1;
}

.media-info {
    padding: 1rem;
}

.media-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-info p {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.media-year,
.media-type-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.media-overview {
    color: #ccc;
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0.5rem 0;
}

.media-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.watch-btn {
    flex: 1;
    background: #e50914;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    font-size: 0.85rem;
    font-weight: bold;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
}

.watch-btn:hover {
    background: #b8070f;
}

.show-details-btn {
    background: transparent;
    border: 2px solid #555;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    white-space: nowrap;
}

.show-details-btn:hover {
    border-color: #e50914;
    color: #e50914;
}

.favorite-btn {
    background: transparent;
    border: 2px solid #555;
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.favorite-btn:hover {
    border-color: #e50914;
    color: #e50914;
}

.favorite-btn.active {
    background: #e50914;
    border-color: #e50914;
    color: #ffffff;
}

.favorite-btn.active i {
    color: #ffffff;
}


/* Empty State */

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-content {
    max-width: 400px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 4rem;
    color: #555;
    margin-bottom: 1rem;
}

.empty-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #999;
}

.empty-content p {
    color: #777;
}


/* Search Page */

.search-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.search-header h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #ffffff;
}

.error-message {
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid #e50914;
    color: #ff6b6b;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.no-results {
    text-align: center;
    padding: 4rem 1rem;
}

.no-results-icon {
    font-size: 3rem;
    color: #555;
    margin-bottom: 1rem;
}

.search-suggestions {
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
}

.suggestions-content h2 {
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.suggestion-tag {
    background: #333;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.suggestion-tag:hover {
    background: #e50914;
    transform: translateY(-2px);
}


/* Episode Navigation */

.episode-navigation {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid #333;
}

.episode-nav-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #333;
    color: #ffffff;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    min-width: 140px;
    border: 2px solid transparent;
}

.nav-btn:hover:not(.disabled) {
    background: #e50914;
    border-color: #e50914;
    transform: translateY(-2px);
}

.nav-btn.disabled {
    background: #1a1a1a;
    color: #666;
    cursor: not-allowed;
}

.nav-btn-text {
    display: flex;
    flex-direction: column;
}

.nav-label {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 2px;
}

.nav-episode {
    font-weight: bold;
    font-size: 0.9rem;
}

.episode-info-compact {
    text-align: center;
    flex: 1;
    max-width: 200px;
}

.current-episode {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #e50914;
    margin-bottom: 4px;
}

.episode-count {
    display: block;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 8px;
}

.season-progress {
    margin: 8px 0;
}

.progress-bar {
    background: #333;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #e50914, #ff6b6b);
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.episode-settings {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.auto-next-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #ccc;
}

.auto-next-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 40px;
    height: 20px;
    background: #333;
    border-radius: 10px;
    position: relative;
    transition: all 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #666;
    border-radius: 50%;
    transition: all 0.3s;
}

.auto-next-toggle input:checked+.toggle-slider {
    background: #e50914;
}

.auto-next-toggle input:checked+.toggle-slider::before {
    background: #ffffff;
    transform: translateX(20px);
}

.mark-watched-btn {
    background: transparent;
    border: 2px solid #555;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mark-watched-btn:hover {
    border-color: #e50914;
    background: #e50914;
}

.mark-watched-btn.watched {
    background: #22c55e;
    border-color: #22c55e;
}


/* Next Episode Overlay */

.next-episode-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 280px;
    display: none;
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    animation: slideInUp 0.3s ease-out;
}

.next-episode-overlay.show {
    display: block;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.overlay-text h3 {
    margin: 0 0 4px 0;
    color: #ffffff;
    font-size: 1.1rem;
}

.overlay-text p {
    margin: 0;
    color: #e50914;
    font-weight: bold;
    font-size: 1rem;
}

.overlay-countdown {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

.countdown-circle {
    width: 50px;
    height: 50px;
    border: 3px solid #e50914;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: countdown-pulse 1s ease-in-out infinite;
}

.countdown-circle::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 3px solid transparent;
    border-top-color: #e50914;
    border-radius: 50%;
    animation: countdown-spin 10s linear;
}

#countdown-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e50914;
}

.overlay-controls {
    display: flex;
    gap: 0.5rem;
}

.cancel-btn,
.play-now-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s;
}

.cancel-btn {
    background: #333;
    color: #ffffff;
}

.cancel-btn:hover {
    background: #555;
}

.play-now-btn {
    background: #e50914;
    color: #ffffff;
}

.play-now-btn:hover {
    background: #b8070f;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes countdown-pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes countdown-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


/* Show Page */

.show-page {
    min-height: 100vh;
}

.show-header {
    position: relative;
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
}

.show-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.backdrop-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.backdrop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 15, 15, 0.3) 0%, rgba(15, 15, 15, 0.7) 70%, rgba(15, 15, 15, 1) 100%);
}

.show-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 2;
}

.show-details {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.show-poster {
    flex-shrink: 0;
    width: 200px;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.show-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.show-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.show-meta h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.show-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.show-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #cccccc;
    font-size: 0.9rem;
}

.rating {
    color: #ffd700 !important;
}

.status {
    background: #333;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem !important;
}

.show-genres {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.genre-tag {
    background: rgba(229, 9, 20, 0.2);
    border: 1px solid #e50914;
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.show-overview {
    color: #cccccc;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 600px;
}

.show-actions {
    display: flex;
    gap: 1rem;
}

.play-btn {
    background: #e50914;
    color: #ffffff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.play-btn:hover {
    background: #b8070f;
    transform: translateY(-2px);
}


/* Seasons Container */

.seasons-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.seasons-container h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
}

.season-section {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid #333;
}

.season-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: rgba(40, 40, 40, 0.8);
    cursor: pointer;
    transition: background-color 0.3s;
}

.season-header:hover {
    background: rgba(50, 50, 50, 0.8);
}

.season-info {
    flex: 1;
}

.season-info h3 {
    font-size: 1.4rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.episode-count,
.season-year {
    color: #999;
    font-size: 0.9rem;
    margin-right: 1rem;
}

.season-progress {
    flex: 1;
    max-width: 300px;
    margin: 0 2rem;
}

.progress-info {
    text-align: center;
    color: #ccc;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.progress-bar-container {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e50914, #ff6b6b);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.season-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s;
}

.season-toggle:hover {
    background: rgba(229, 9, 20, 0.2);
}

.season-toggle i {
    transition: transform 0.3s;
}


/* Episodes Grid */

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.episode-card {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid #333;
}

.episode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.3);
}

.episode-card.watched {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.episode-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.episode-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.episode-card:hover .episode-thumbnail img {
    transform: scale(1.05);
}

.placeholder-thumbnail {
    width: 100%;
    height: 100%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #666;
}

.episode-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.episode-card:hover .episode-overlay {
    opacity: 1;
}

.play-episode-btn {
    background: #e50914;
    color: #ffffff;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.3s;
}

.play-episode-btn:hover {
    background: #b8070f;
    transform: scale(1.1);
}

.watched-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #22c55e;
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.episode-info {
    padding: 1rem;
}

.episode-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.episode-number {
    background: #333;
    color: #ffffff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.episode-title {
    font-size: 1rem;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.episode-runtime,
.episode-rating {
    color: #999;
    font-size: 0.8rem;
    margin-right: 1rem;
}

.episode-rating {
    color: #ffd700;
}

.episode-overview {
    color: #ccc;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mark-episode-watched {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.mark-episode-watched:hover {
    border-color: #22c55e;
    color: #22c55e;
}

.mark-episode-watched.watched {
    background: #22c55e;
    border-color: #22c55e;
    color: #ffffff;
}

.no-episodes {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #666;
}


/* Player Page */

.player-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 8px;
}

.player-header h1 {
    font-size: 1.5rem;
    color: #ffffff;
    flex: 1;
    margin: 0 1rem;
}

.back-btn {
    background: transparent;
    border: 2px solid #555;
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-btn:hover {
    border-color: #e50914;
    color: #e50914;
}

.player-actions .favorite-btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-container {
    margin-bottom: 2rem;
}

.player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.player-info {
    background: rgba(26, 26, 26, 0.8);
    padding: 2rem;
    border-radius: 8px;
}

.media-details {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.media-poster-small {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.media-text h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.episode-info {
    color: #e50914;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.media-type-info {
    color: #999;
    margin-bottom: 1rem;
}


/* Footer */

.footer {
    background: #1a1a1a;
    border-top: 1px solid #333;
    padding: 2rem 1rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    color: #777;
}


/* Responsive Design */

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    .nav-search {
        order: 2;
        margin: 0;
        max-width: none;
        width: 100%;
    }
    .nav-links {
        order: 1;
        gap: 1rem;
    }
    .main-content {
        margin-top: 140px;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    .player-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .player-header h1 {
        margin: 0;
    }
    .media-details {
        flex-direction: column;
        text-align: center;
    }
    .suggestion-tags {
        justify-content: center;
        gap: 0.5rem;
    }
    /* Mobile show page adjustments */
    .show-header {
        height: 50vh;
        min-height: 300px;
    }
    .show-details {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .show-poster {
        width: 150px;
        height: 225px;
        margin: 0 auto;
    }
    .show-meta h1 {
        font-size: 2rem;
    }
    .show-stats {
        justify-content: center;
    }
    .show-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    .seasons-container {
        padding: 1rem;
    }
    .season-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .season-progress {
        max-width: none;
        margin: 0;
        width: 100%;
    }
    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }
    /* Mobile episode navigation adjustments */
    .episode-navigation {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    .episode-nav-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    .nav-btn {
        width: 100%;
        justify-content: center;
        min-width: auto;
    }
    .episode-info-compact {
        order: -1;
        max-width: none;
        margin-bottom: 0.5rem;
    }
    .episode-settings {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    .auto-next-toggle {
        justify-content: center;
    }
    .mark-watched-btn {
        width: 100%;
        justify-content: center;
    }
    .next-episode-overlay {
        left: 10px;
        right: 10px;
        bottom: 10px;
        min-width: auto;
    }
    /* Mobile autocomplete adjustments */
    .autocomplete-dropdown {
        max-height: 300px;
        margin-top: 4px;
    }
    .autocomplete-item {
        padding: 10px 12px;
    }
    .autocomplete-poster {
        width: 35px;
        height: 52px;
        margin-right: 10px;
    }
    .autocomplete-title {
        font-size: 0.85rem;
    }
    .autocomplete-meta {
        gap: 6px;
    }
    .autocomplete-overview {
        display: none;
        /* Hide overview on mobile for cleaner look */
    }
}

@media (max-width: 480px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .hero-search-form {
        flex-direction: column;
    }
    .hero-search-btn {
        border-radius: 0 0 30px 30px;
    }
}


/* Error Page Styles */

.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    margin-top: 4rem;
    /* Account for navbar */
}

.error-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.error-icon {
    margin-bottom: 2rem;
}

.error-icon i {
    font-size: 4rem;
    color: #e50914;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

.error-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.error-message {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #b3b3b3;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.error-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    justify-content: center;
}

.error-actions .btn-primary {
    background: linear-gradient(135deg, #e50914, #b20710);
    color: white;
}

.error-actions .btn-primary:hover {
    background: linear-gradient(135deg, #f40612, #d8070f);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.4);
}

.error-actions .btn-secondary {
    background: #333333;
    color: white;
    border: 1px solid #555;
}

.error-actions .btn-secondary:hover {
    background: #555555;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(51, 51, 51, 0.4);
}

@keyframes pulse {
    0% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        opacity: 0.8;
    }
}


/* Error Page Mobile Styles */

@media (max-width: 768px) {
    .error-page {
        padding: 1rem;
        margin-top: 3rem;
    }
    .error-title {
        font-size: 2rem;
    }
    .error-message {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    .error-actions .btn {
        width: 200px;
        justify-content: center;
    }
    .error-icon i {
        font-size: 3rem;
    }
}