/* Variáveis CSS */
:root {
    --primary-color: #0066ff;
    --secondary-color: #4285f4;
    --background-color: #000000;
    --surface-color: #141414;
    --menu-color: rgba(0, 0, 0, 0.7);
    --text-color: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-radius: 8px;
    --transition-duration: 0.3s;
    --menu-width: 100%;
    --sidebar-bg: #1a1a1a;
    --card-bg: #1e1e1e;
    --border-color: #2a2a2a;
    --hover-color: #282828;
}

/* Reset e estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #000428, #004e92);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
}

/* Telas */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    transition: opacity var(--transition-duration);
}

.screen.hidden {
    display: none;
}

/* Tela de Login */
.login-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    text-align: center;
}

.login-form {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 1rem;
}

.btn-login {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color var(--transition-duration);
}

.btn-login:hover {
    background-color: var(--secondary-color);
}

/* Tela Principal (Home) */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.5);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform var(--transition-duration);
}

.menu-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.menu-item i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Telas de Conteúdo */
.screen-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.search-box {
    position: relative;
    margin-left: auto;
}

.search-box input {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--text-color);
    width: 250px;
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.content-layout {
    display: flex;
    height: calc(100vh - 60px);
}

.categories-sidebar {
    width: 250px;
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    overflow-y: auto;
}

.category-item {
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-duration);
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.category-item.active {
    background: var(--primary-color);
}

.content-area {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.content-item {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: visible;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.content-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.image-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: var(--surface-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
}

.image-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--surface-color) 0%,
        var(--hover-color) 50%,
        var(--surface-color) 100%
    );
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.content-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    z-index: 1;
}

.content-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: var(--text-color);
    z-index: 3;
}

.content-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.content-extra {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    z-index: 2;
}

.content-extra span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-extra i {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Player */
#player-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
    display: none;
}

#player-container.hidden {
    display: none !important;
}

.player-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.player-header.hidden {
    opacity: 0;
    pointer-events: none;
}

.player-header .btn-back {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    margin-right: 15px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.player-header .btn-back:hover {
    opacity: 1;
}

.player-header h2 {
    color: #fff;
    font-size: 20px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.player-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-container:hover .player-controls,
.player-controls:hover {
    opacity: 1;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    margin-bottom: 15px;
}

.progress-bar:hover {
    height: 6px;
}

.progress-current,
.progress-buffer {
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
}

.progress-buffer {
    background: rgba(255,255,255,0.4);
}

.progress-current {
    background: #E50914;
}

.control-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    padding: 10px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.control-button:hover {
    opacity: 1;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

#volume-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.3);
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.time-display {
    color: #fff;
    font-size: 14px;
    margin-left: auto;
}

/* Estilo Netflix para buffering */
.buffering-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #E50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

#player-container.buffering .buffering-spinner {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Notificações de erro */
.error-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff4444;
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease-out;
    z-index: 2000;
}

.error-notification.fade-out {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Responsividade */
@media (max-width: 768px) {
    .content-layout {
        flex-direction: column;
    }

    .categories-sidebar {
        width: 100%;
        height: auto;
        max-height: 100px;
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }

    .category-item {
        white-space: nowrap;
        margin: 0 0.5rem 0 0;
    }

    .search-box input {
        width: 200px;
    }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }
}

/* Layout principal */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: rgba(0, 0, 0, 0.5);
}

/* Logo */
.logo-container {
    text-align: center;
    padding: 40px 0;
}

.logo {
    max-width: 300px;
    height: auto;
}

/* Menu Principal */
.main-menu {
    width: var(--menu-width);
    background-color: var(--menu-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.menu-items {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    max-width: 1200px;
    padding: 20px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 150px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all var(--transition-duration);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.menu-item i {
    font-size: 40px;
    margin-bottom: 10px;
}

.menu-item span {
    font-size: 18px;
    font-weight: 500;
}

.menu-item:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
}

.menu-item.active {
    background: rgba(0, 102, 255, 0.3);
    border-color: var(--primary-color);
}

/* Conteúdo Principal */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Área do Player */
#player-container {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: black;
    position: relative;
}

#player-container.player-hidden {
    height: 0;
    aspect-ratio: auto;
}

#video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Área de Conteúdo */
#content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

#section-title {
    font-size: 24px;
    font-weight: 600;
}

/* Mensagem de nenhum conteúdo */
.no-content {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Imagens de conteúdo */
.image-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.content-item:hover .content-image {
    transform: scale(1.05);
}

/* Efeito de carregamento */
.image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

/* Remove o efeito de carregamento quando a imagem estiver carregada */
.content-image[src^="http"] + .image-container::before {
    display: none;
}

/* Modo tela cheia */
#player-container:fullscreen,
#player-container:-webkit-full-screen,
#player-container:-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-color);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Layout da seção Live TV */
.live-container {
    display: flex;
    width: 100%;
    height: 100%;
    background: var(--background-color);
}

/* Estilos para a barra lateral de categorias */
.categories-sidebar {
    width: 250px;
    height: 100%;
    background: var(--sidebar-bg);
    padding: 1rem;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

/* Estilos para os itens de categoria */
.category-item {
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.category-item:hover {
    background: var(--hover-color);
}

.category-item.active {
    background: var(--primary-color);
    color: white;
}

/* Estilos para a área de canais */
.channels-area {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    align-content: start;
}

/* Estilos para os itens de canal */
.content-item {
    position: relative;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.content-item:hover {
    transform: translateY(-5px);
}

.image-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Proporção 16:9 */
}

.content-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-info {
    padding: 0.8rem;
}

.content-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--text-color);
}

.content-extra {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Mensagem de nenhum conteúdo */
.no-content {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Imagens de conteúdo */
.image-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.content-item:hover .content-image {
    transform: scale(1.05);
}

/* Efeito de carregamento */
.image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

/* Remove o efeito de carregamento quando a imagem estiver carregada */
.content-image[src^="http"] + .image-container::before {
    display: none;
}

.sidebar-search {
    margin-bottom: 1rem;
    position: relative;
}

.category-search {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 0.9rem;
}

.category-search:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-search i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.categories-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Estiliza a scrollbar da lista de categorias */
.categories-list::-webkit-scrollbar {
    width: 6px;
}

.categories-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.categories-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.categories-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-overlay.fade-out {
    opacity: 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

.loading-text {
    color: var(--text-color);
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.loading-status {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    max-width: 80%;
    opacity: 0.8;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Popup de Detalhes do Filme */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
}

.movie-details-popup {
    background: #1a1a1a;
    border-radius: 8px;
    max-width: 1000px;
    width: 90%;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    z-index: 1001;
    padding: 20px;
    color: #fff;
    transition: all 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.movie-details-popup.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.movie-details-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.movie-details-top {
    display: flex;
    gap: 30px;
}

.movie-details-poster {
    flex: 0 0 300px;
}

.movie-details-poster img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.movie-details-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.movie-details-title {
    font-size: 32px;
    margin: 0 0 10px 0;
    color: #fff;
}

.movie-details-year {
    font-size: 16px;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.movie-details-overview {
    font-size: 16px;
    line-height: 1.6;
    color: #ccc;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    flex: 1;
    margin-bottom: 20px;
}

.movie-details-actions {
    margin-top: auto;
}

.movie-details-bottom {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
}

.movie-details-metadata {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.metadata-item.rating {
    font-size: 24px;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metadata-item.rating i {
    color: #ffd700;
}

.metadata-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metadata-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #ccc;
}

.metadata-item i {
    width: 16px;
    color: #ffd700;
}

.btn-play {
    background: #e50914;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.btn-play:hover {
    background: #f40612;
}

.btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

.btn-close:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .movie-details-top {
        flex-direction: column;
    }

    .movie-details-poster {
        flex: none;
        max-width: 300px;
        margin: 0 auto;
    }

    .movie-details-info {
        text-align: center;
    }

    .movie-details-year {
        justify-content: center;
    }

    .movie-details-actions {
        display: flex;
        justify-content: center;
    }

    .metadata-row {
        justify-content: center;
    }
}

/* Popup de Detalhes da Série */
.series-details-popup {
    background: #1a1a1a;
    border-radius: 8px;
    max-width: 1000px;
    width: 90%;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    z-index: 1001;
    padding: 20px;
    color: #fff;
    transition: all 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.series-details-popup.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.series-details-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.series-details-top {
    display: flex;
    gap: 30px;
}

.series-details-poster {
    flex: 0 0 300px;
}

.series-details-poster img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.series-details-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.series-details-title {
    font-size: 32px;
    margin: 0 0 10px 0;
    color: #fff;
}

.series-details-year {
    font-size: 16px;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.series-details-overview {
    font-size: 16px;
    line-height: 1.6;
    color: #ccc;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    flex: 1;
    margin-bottom: 20px;
}

.series-details-bottom {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
}

.seasons-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.seasons-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.season-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.season-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.season-button.active {
    background: #e50914;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.season-episodes {
    display: none;
}

.season-episodes.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.episode-item {
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.episode-item:hover {
    transform: translateY(-2px);
}

.episode-thumbnail {
    position: relative;
    flex: 0 0 200px;
    height: 112px;
    overflow: hidden;
}

.episode-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-play-episode {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(229, 9, 20, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.episode-item:hover .btn-play-episode {
    opacity: 1;
}

.episode-info {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.episode-title {
    font-size: 18px;
    margin: 0;
    color: #fff;
}

.episode-duration {
    font-size: 14px;
    color: #ffd700;
}

.episode-description {
    font-size: 14px;
    color: #ccc;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .series-details-top {
        flex-direction: column;
    }

    .series-details-poster {
        flex: none;
        max-width: 300px;
        margin: 0 auto;
    }

    .series-details-info {
        text-align: center;
    }

    .series-details-year {
        justify-content: center;
    }

    .episode-item {
        flex-direction: column;
    }

    .episode-thumbnail {
        flex: none;
        height: 180px;
    }

    .btn-play-episode {
        opacity: 1;
    }
}

/* Tela de Detalhes da Série */
#series-details-screen {
    background: var(--background-color);
    overflow-y: auto;
    position: relative;
    overflow: hidden;
}

.series-details-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.series-details-top {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.series-details-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.series-details-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-details-info {
    color: var(--text-color);
}

.series-details-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.series-details-year {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.series-details-overview {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.series-details-metadata {
    margin-bottom: 2rem;
}

.metadata-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.metadata-row .metadata-item {
    background: var(--surface-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metadata-details {
    display: grid;
    gap: 1rem;
}

.metadata-details .metadata-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.seasons-container {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.seasons-list {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.seasons-list button {
    background: var(--card-bg);
    border: none;
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-duration);
    white-space: nowrap;
}

.seasons-list button:hover,
.seasons-list button.active {
    background: var(--primary-color);
}

.episodes-list {
    display: grid;
    gap: 1rem;
}

.episode-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-duration);
}

.episode-item:hover {
    transform: translateY(-2px);
}

.episode-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
}

.episode-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-play-episode {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-duration);
}

.episode-item:hover .btn-play-episode {
    opacity: 1;
}

.episode-info {
    padding: 1rem;
}

.episode-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.episode-duration {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.episode-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .series-details-top {
        grid-template-columns: 1fr;
    }

    .series-details-poster {
        max-width: 300px;
        margin: 0 auto;
    }

    .episode-item {
        grid-template-columns: 1fr;
    }
}

.screen-nav {
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.screen-nav h1 {
    color: #fff;
    margin: 0;
    font-size: 1.5rem;
}

.screen-nav .btn-back {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.screen-nav .btn-back:hover {
    background: rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
    .series-details-container {
        padding: 1rem;
    }

    .series-details-top {
        grid-template-columns: 1fr;
    }

    .series-details-poster {
        max-width: 300px;
        margin: 0 auto;
    }

    .series-details-title {
        font-size: 2rem;
        text-align: center;
    }

    .series-details-year {
        justify-content: center;
    }

    .metadata-row {
        justify-content: center;
    }

    .episode-item {
        grid-template-columns: 1fr;
    }

    .episode-thumbnail {
        height: 200px;
    }

    .btn-play-episode {
        opacity: 1;
    }
}

/* Estilos para o background do YouTube */
.youtube-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.youtube-background #youtube-player {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

.youtube-background .youtube-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9));
}

#series-details-screen {
    position: relative;
    overflow: hidden;
}


