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

body {
    font-family: "Poppins", sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 0;
    margin: 0;
}

/* Header */
.tv-header {
    padding: 1.5rem 3rem;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0) 100%
    );
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .tv-header {
        padding: 1rem;
    }
}

.tv-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .tv-header-content {
        gap: 0.75rem;
    }
}

.tv-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .tv-logo {
        width: 100%;
        justify-content: center;
    }
}

.tv-logo img {
    width: 48px;
    height: 48px;
}

.tv-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    .tv-logo h1 {
        font-size: 1.5rem;
    }

    .tv-logo img {
        width: 36px;
        height: 36px;
    }
}

.tv-header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .tv-header-controls {
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tv-header-controls::-webkit-scrollbar {
        display: none;
    }
}

.tv-search {
    position: relative;
}

.tv-search input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.75rem 3rem 0.75rem 1.25rem;
    color: white;
    font-size: 1rem;
    width: 300px;
    transition: all 0.3s ease;
}

.tv-search-desktop {
    position: relative;
}

.tv-btn-mobile-search {
    display: none;
}

@media (max-width: 768px) {
    .tv-search-desktop {
        display: none;
    }

    .tv-btn-mobile-search {
        display: flex;
    }
}

.tv-search input:focus {
    outline: none;
    border-color: #ef4444;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.tv-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.tv-search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0.5;
}

.tv-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .tv-btn {
        padding: 0.6rem;
        min-width: 40px;
        justify-content: center;
    }

    .tv-btn span {
        display: none;
    }

    .tv-btn svg {
        margin: 0;
    }

    .tv-btn-mobile-search {
        order: -1;
    }
}

.tv-btn:hover,
.tv-btn:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

@media (hover: none) {
    .tv-btn:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .tv-btn.active:hover {
        background: rgba(239, 68, 68, 0.2);
        border-color: #ef4444;
    }

    .tv-btn:active {
        transform: scale(0.98);
    }
}

.tv-btn.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.tv-badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    position: absolute;
    top: -5px;
    right: -5px;
}

@media (max-width: 768px) {
    .tv-btn {
        position: relative;
    }
}

main {
    padding: 8rem 3rem 3rem;
    max-width: 1920px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    main {
        padding: 11rem 1rem 2rem;
    }
}

/* Filters Section */
.tv-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .tv-filters {
        gap: 0.5rem;
        margin: 1.75rem 0 1.5rem;
        width: 100%;
        justify-content: space-between;
        align-items: stretch;
        flex-wrap: wrap;
    }

    .tv-filter-group {
        flex: 1 1 calc(33.333% - 0.35rem);
        min-width: calc(33.333% - 0.35rem);
        max-width: calc(33.333% - 0.35rem);
    }
}

.tv-filter-group {
    display: flex;
    gap: 0.5rem;
}

.tv-select {
    padding: 0.875rem 1.25rem;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .tv-select {
        padding: 0.7rem 0.6rem;
        font-size: 0.8rem;
        min-height: 44px;
        border-radius: 12px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 500;
        border-width: 2px;
        background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.08) 100%
        );
    }
}

.tv-select-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
}

@media (max-width: 768px) {
    .tv-select-button {
        justify-content: center;
        gap: 0.4rem;
    }

    .tv-select-button span {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.tv-select-button svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .tv-select-button svg {
        width: 14px;
        height: 14px;
    }
}

.tv-select-button:hover svg {
    transform: translateY(2px);
    opacity: 1;
}

.tv-select:hover,
.tv-select:focus {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.12) 100%
    );
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
    outline: none;
}

.tv-select option {
    background: #1a1a1a;
    color: white;
}

.tv-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    position: relative;
    padding-left: 1.5rem;
}

.tv-section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    border-radius: 3px;
}

.tv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    contain: layout style;
}

@media (max-width: 1024px) {
    .tv-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .tv-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }

    .tv-card {
        max-height: 240px;
        width: 100%;
    }

    .tv-card-poster {
        object-fit: cover;
        height: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tv-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }

    .tv-card {
        max-height: 220px;
    }
}

.tv-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition:
        transform 0.2s ease-out,
        border-color 0.2s ease-out,
        box-shadow 0.2s ease-out;
    position: relative;
    border: 2px solid transparent;
    aspect-ratio: 2/3;
    display: flex;
    flex-direction: column;
    contain: layout style paint;
}

.tv-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(239, 68, 68, 0) 0%,
        rgba(239, 68, 68, 0.2) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.tv-card:hover,
.tv-card:focus {
    transform: scale(1.03);
    border-color: #ef4444;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
    outline: none;
}

@media (hover: none) {
    .tv-card:hover,
    .tv-card:focus {
        transform: none;
        border-color: transparent;
        box-shadow: none;
    }

    .tv-card:active {
        transform: scale(0.98);
    }
}

.tv-card:hover::before,
.tv-card:focus::before {
    opacity: 1;
}

.tv-card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.05);
}

.tv-card-poster:not([src]),
.tv-card-poster[src=""] {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

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

.tv-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: 2;
}

.tv-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .tv-card-title {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
        margin-bottom: 0.25rem;
    }

    .tv-card-info {
        padding: 0.75rem;
    }

    .tv-card-meta {
        font-size: 0.7rem;
        gap: 0.5rem;
    }
}

.tv-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.tv-card-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #fbbf24;
}

.tv-card-year {
    color: rgba(255, 255, 255, 0.7);
}

.tv-card-watchlater {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
}

.tv-card:hover .tv-card-watchlater {
    opacity: 1;
}

@media (hover: none) {
    .tv-card-watchlater {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .tv-card-watchlater {
        opacity: 1;
        width: 32px;
        height: 32px;
    }
}

.tv-card-watchlater:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: #ef4444;
}

.tv-card-watchlater.active {
    background: rgba(239, 68, 68, 0.9);
    border-color: #ef4444;
}

.tv-card-watchlater svg {
    width: 18px;
    height: 18px;
    color: white;
}

/* Loading & Messages */
.tv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.tv-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ef4444;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

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

.tv-message-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tv-message-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.tv-load-more {
    margin: 2rem 0;
    text-align: center;
}

/* Modal */
.tv-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.tv-modal-content {
    background: rgba(15, 15, 15, 0.98);
    border-radius: 20px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.tv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tv-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
}

.tv-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tv-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.tv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.tv-empty-icon {
    width: 80px;
    height: 80px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 1.5rem;
}

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

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

/* Responsive adjustments */
@media (max-width: 1024px) {
    .tv-header {
        padding: 1.5rem 2rem;
    }

    .tv-container {
        padding: 7rem 2rem 2rem;
    }

    .tv-search input {
        width: 200px;
    }

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

@media (max-width: 768px) {
    .tv-search input {
        width: 100%;
        max-width: 100%;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }

    .tv-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .tv-card {
        border-radius: 12px;
    }
}

/* Large TV screens optimization */
@media (min-width: 1920px) {
    .tv-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 2rem;
    }

    .tv-card-title {
        font-size: 0.95rem;
    }
}

/* Episode/Genre Selector Sidebar */
.episode-selector {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    background: linear-gradient(
        to left,
        rgba(15, 15, 15, 0.98) 0%,
        rgba(0, 0, 0, 0.95) 100%
    );
    backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    overflow-y: auto;
    border-left: 2px solid rgba(239, 68, 68, 0.3);
    -webkit-overflow-scrolling: touch;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .episode-selector {
        width: 85%;
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .episode-selector {
        width: 100%;
        max-width: 100%;
    }
}

.episode-selector.active {
    transform: translateX(0);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.9);
}

.episode-selector-header {
    padding: 2rem;
    border-bottom: 2px solid rgba(239, 68, 68, 0.3);
    position: sticky;
    top: 0;
    background: linear-gradient(
        180deg,
        rgba(15, 15, 15, 1) 0%,
        rgba(15, 15, 15, 0.98) 100%
    );
    z-index: 1;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .episode-selector-header {
        padding: 1.5rem;
    }
}

.episode-selector-back {
    background: linear-gradient(
        135deg,
        rgba(239, 68, 68, 0.15) 0%,
        rgba(220, 38, 38, 0.1) 100%
    );
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 14px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #ef4444;
    flex-shrink: 0;
    box-shadow:
        0 4px 12px rgba(239, 68, 68, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.episode-selector-back::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.episode-selector-back:hover {
    background: linear-gradient(
        135deg,
        rgba(239, 68, 68, 0.25) 0%,
        rgba(220, 38, 38, 0.2) 100%
    );
    border-color: #ef4444;
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.episode-selector-back:hover::before {
    opacity: 1;
}

.episode-selector-back:active {
    transform: translateY(0) scale(0.96);
    box-shadow:
        0 2px 8px rgba(239, 68, 68, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.episode-selector-back svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.episode-selector-back:hover svg {
    transform: translateX(-2px);
}

.episode-selector-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.episodes-list {
    padding: 1.5rem 1rem;
}

@media (max-width: 768px) {
    .episodes-list {
        padding: 0.75rem;
    }
}

.episode-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.04) 100%
    );
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 56px;
    position: relative;
    overflow: hidden;
}

.episode-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.episode-item:hover,
.episode-item:focus {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.08) 100%
    );
    border-color: rgba(239, 68, 68, 0.6);
    transform: translateX(-4px);
    outline: none;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.episode-item:hover::before,
.episode-item:focus::before {
    transform: scaleY(1);
}

@media (hover: none) {
    .episode-item:hover,
    .episode-item:focus {
        transform: none;
        background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.04) 100%
        );
        border-color: rgba(255, 255, 255, 0.1);
    }

    .episode-item:active {
        transform: scale(0.98);
    }
}

@media (max-width: 768px) {
    .episode-item {
        padding: 0.75rem;
        gap: 0.75rem;
        border-radius: 8px;
    }
}

.episode-item.current {
    border-color: #ef4444;
    background: linear-gradient(
        135deg,
        rgba(239, 68, 68, 0.2) 0%,
        rgba(220, 38, 38, 0.15) 100%
    );
    box-shadow:
        0 4px 16px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.episode-item.current::before {
    transform: scaleY(1);
}

.episode-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.episode-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.01em;
    transition: color 0.3s ease;
}

.episode-item:hover .episode-title {
    color: #ef4444;
}

.episode-item.current .episode-title {
    color: #ef4444;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Watch Later Modal */
@media (max-width: 768px) {
    .tv-modal {
        padding: 1rem;
    }

    .tv-modal-content {
        border-radius: 16px;
    }
}

@media (max-width: 768px) {
    .tv-loading,
    .tv-message {
        padding: 3rem 1.5rem;
    }

    .tv-message-title {
        font-size: 1.25rem;
    }

    .tv-message-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .tv-section-title {
        font-size: 1.25rem;
        padding-left: 1rem;
    }
}

@media (min-width: 2560px) {
    body {
        font-size: 18px;
    }

    .tv-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2.5rem;
    }

    .tv-card:hover,
    .tv-card:focus {
        transform: scale(1.03);
    }

    .tv-filters {
        gap: 1.5rem;
    }
}

*:focus-visible {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

.tv-card-poster,
.tv-btn,
.tv-modal {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

.tv-card:focus {
    transform: scale(1.03);
    border-color: #ef4444;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Optimize scrolling performance */
* {
    -webkit-overflow-scrolling: touch;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #dc2626;
}

/* Mobile Search Modal */
.tv-mobile-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f0f0f;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}

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

.tv-mobile-search-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.tv-mobile-search-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 1rem;
}

.tv-mobile-search-back {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tv-mobile-search-back:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tv-mobile-search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.tv-mobile-search-input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.875rem 3rem 0.875rem 1.25rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tv-mobile-search-input-wrapper input:focus {
    outline: none;
    border-color: #ef4444;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.tv-mobile-search-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.tv-mobile-search-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tv-mobile-search-clear:hover {
    color: white;
}

.tv-mobile-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.tv-mobile-search-results .tv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0;
}

.tv-mobile-search-results .tv-card {
    width: 100%;
}

@media (max-width: 480px) {
    .tv-mobile-search-results .tv-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

.tv-mobile-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 50vh;
}

.tv-mobile-search-empty-icon {
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 1.5rem;
}

.tv-mobile-search-empty h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.tv-mobile-search-empty p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin: 0;
}

@media (min-width: 769px) {
    .tv-mobile-search-modal {
        display: none !important;
    }
}
