/* Estilos gerais */
html, body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #0d0d0d;
    color: #fff;
    height: 100%;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar{
    display: none;
}

/* Seção de Jogos ao Vivo na Home */
.live-games-section {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/soccer-background.svg');
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin: 20px 0;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.live-games-content {
    max-width: 600px;
    margin: 0 auto;
}

.live-games-content h2 {
    font-size: 2.1em;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.live-games-content p {
    font-size: 1.2em;
    margin-bottom: 25px;
    color: #ddd;
}

.btn-live-games {
    background-color: #e50914;
    color: white;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 30px;
    transition: background-color 0.3s, transform 0.3s;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid transparent;
}

.btn-live-games:hover {
    background-color: #222;
    transform: translateY(-5px);
    border-bottom: 2px solid red;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-full {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    margin: 0;
    background-color: #0d0d0d;
    overflow: auto;
}

.container-full {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    background-color: #0d0d0d;
    overflow: auto;
}

header {
    background-color: #0d0d0d;
    padding: 20px 0;
    text-align: center;
}

header h1 {
    margin: 0;
    color: #e50914;
}

#searchInput {
    width: 40%;
    text-align: center;
    padding: 14px;
    margin-top: 15px;
    border: none;
    border-radius: 5px;
    background-color: #333;
    color: #fff;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.channel-card {
    background-color: #282828;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.channel-card img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}

.channel-card h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #fff;
}

.btn {
    display: inline-block;
    padding: 10px 15px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
}

.btn-watch {
    background-color: #e50914;
}

.btn-embed {
    background-color: #555;
}

.btn-watch:hover {
    background-color: #ff2a3a;
}

.btn-embed:hover {
    background-color: #777;
}

.btn-watch,
.btn-share {
    width: 100%;
    max-width: 150px;
    text-align: center;
    background-color: #e50914;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.4s;
    margin: 5px;
    border-top: 2px solid transparent;
    border-bottom: 2px solid transparent;
}

.btn-watch:hover,
.btn-share:hover {
    background-color: #222;
    transition: background 0.4s;
    border-bottom: 2px solid red;
    border-top: 2px solid red;
}

footer {
    background-color: #0d0d0d;
    padding: 20px 0;
    text-align: center;
    margin-top: 20px;
}

footer p {
    margin: 0;
    color: #aaa;
}

/* Channel Page */
.channel-header {
    display: flex;
    align-items: center;
    justify-content: center; /* Centraliza o conteúdo principal */
    margin-bottom: 20px;
    padding: 0 10px; /* Adiciona padding e mantém espaço para o botão abs-posicionado */
    position: relative; /* Necessário para posicionamento absoluto dos filhos */
}

.channel-header h2 {
    flex-grow: 1; /* Permite que o título ocupe o espaço restante */
    text-align: center; /* Centraliza o texto do título */
    margin: 0; /* Remove margens padrão */
}

.home-button {
    background-color: #e50914;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
    position: absolute; /* Posiciona o botão de forma absoluta */
    left: 10px; /* Alinha o botão à esquerda */
}

.home-button:hover {
    background-color: #ff2a3a;
}

/* Estilos para o conteúdo do canal */
.channel-content {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    padding: 0;
    margin: 0;
    align-items: stretch;
    justify-content: space-between;
    overflow: hidden;
}

/* Estilo para o nome do canal */
.channel-name {
    color: #e50914;
    font-size: 1.6em;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    width: 100%;
}

.video-player-container {
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 1.5em;
    flex: 3; /* Ocupa 3/4 do espaço disponível */
    height: 100vh;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.video-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Ajustes para dispositivos móveis */
@media (max-width: 768px) {
    .channel-content {
        flex-direction: column;
        height: auto;
        overflow: auto;
    }
    
    #searchInput{
        width: 60%;
        padding: 15px;
    }
    
    .video-player-container {
        width: 100%;
        height: 50vh;
    }
    
    .epg-section {
        max-width: 100%;
        width: 100%;
        margin-top: 2px;
    }
    
    .channel-card {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .btn-watch,
    .btn-share {
        max-width: 100%;
        width: 80%;
        padding: 14px 5px;
        margin: 5px auto;
    }
}
.epg-section {
    background-color: #0d0d0d;
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-width: 250px;
    width: 25%; /* Ocupa 1/4 da largura */
    height: 100vh;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    overflow-y: auto; /* Permite rolagem vertical */
    -webkit-overflow-scrolling: touch; /* Melhora a rolagem em dispositivos iOS */
    flex: 1; /* Ocupa 1/4 do espaço disponível */
}

.epg-section h2 {
    color: #e50914;
    margin-bottom: 10px;
    text-align: center;
}

.epg-title {
    color: #fff;
    font-size: 1.5em; /* Tamanho da fonte como na imagem */
    font-weight: bold;
    margin-bottom: 15px;
    text-align: left;
    border-left: 3px solid #e50914; /* Borda vertical vermelha */
    padding-left: 10px; /* Espaço entre a borda e o texto */
    letter-spacing: 0.5px;
}

.epg-dropdown {
    margin-bottom: 15px;
}

.epg-date-dropdown {
    background-color: #1a1a1a;
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 0;
    text-align: center;
    cursor: pointer;
    position: relative;
    display: block;
    width: 100%;
    border: 1px solid #333;
    box-sizing: border-box;
    font-size: 0.9em;
    font-weight: normal;
}

.epg-date-dropdown::after {
    content: '\25BC'; /* Unicode para seta para baixo */
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
}

.epg-list {
    flex-grow: 1;
    overflow-y: visible;
    padding-right: 5px;
    height: auto; /* Permite que a altura se ajuste ao conteúdo */
    min-height: 0; /* Permite que o conteúdo seja exibido completamente */
    scrollbar-width: thin;
    scrollbar-color: #e50914 #1a1a1a;
}

.epg-list::-webkit-scrollbar {
    width: 6px;
}

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

.epg-list::-webkit-scrollbar-thumb {
    background-color: #e50914;
    border-radius: 6px;
}

.epg-item {
    background-color: #222;
    padding: 15px; /* Aumentado para mais espaço */
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.9em;
    border-bottom: 2px solid red;
    transition: all 0.4s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.epg-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background-color: #2E1819;
}

.epg-item p {
    margin: 0;
    line-height: 1.2;
}

.epg-item h4 {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0 0 8px 0;
    color: #fff;
}

.epg-info {
    display: flex;
    flex-direction: column;
}

.game-details {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.epg-item .btn-watch.small {
    padding: 6px 12px;
    font-size: 0.85em;
    align-self: flex-start;
    margin-top: 5px;
}

.epg-item .program-description {
    font-size: 14px;
    color: #cccccc;
    margin-top: 8px;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Estilo para o programa atual */
.epg-item.current-program {
    background-color: #2E1819;
    border: 2px solid #e50914; /* Borda vermelha para o programa atual */
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
    position: relative;
    padding-left: 15px;
    padding-top: 15px;
    padding-bottom: 5px; /* Aumentado para dar espaço à porcentagem */
    min-height: 70px; /* Altura ajustada para a proporção 16:9 */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Estilo para o próximo programa */
.epg-item.next-program {
    background-color: #1a1a1a;
    border: 2px solid #ffcc00; /* Borda amarela para o próximo programa */
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    position: relative;
    padding-left: 15px;
    padding-top: 15px;
    padding-bottom: 15px;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Adiciona um indicador visual na lateral esquerda para o próximo programa */
.epg-item.next-program::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: #ffcc00;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

/* Estilos para a barra de progresso */
.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #333;
    border-radius: 3px;
    margin-top: 10px;
    overflow: visible !important;
    position: relative;
    margin-bottom: 11px;
}

.progress-bar {
    height: 100%;
    background-color: #e50914;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.progress-circle-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    pointer-events: none;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.progress-percentage {
    font-size: 0.7em;
    color: white;
    background-color: #e50914;
    border: 1px solid #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(229, 9, 20, 0.8), 0 0 15px rgba(229, 9, 20, 0.5);
    position: relative;
    z-index: 30;
    visibility: visible !important;
    opacity: 1 !important;
}


/* Estilo para o container de tempo */
.time-container {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #aaa;
}

.time-icon {
    margin-right: 8px;
    font-size: 16px;
}

.time-text {
    font-size: 0.95em;
}

/* Ajustes específicos para o programa atual */
.epg-item.current-program .time-container {
    margin-bottom: 12px;
}

.epg-item.current-program .program-title {
    font-size: 1.4em;
    margin-top: 8px;
    color: #fff;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.clock-icon {
    width: 16px; /* Aumentado para 16px */
    height: 16px;
    vertical-align: middle;
    margin-right: 8px; /* Ajustado margem para espaçamento */
    filter: brightness(0) invert(1); /* Deixa o SVG branco */
}

/* Estilos para a barra de progresso */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: #333;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #e50914;
    border-radius: 3px;
}

/* Estilo para o próximo programa */
.epg-item.next-program {
    background-color: #1a1a1a;
    border: 2px solid #ffcc00; /* Borda amarela para o próximo programa */
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    position: relative;
    padding-left: 15px;
}

/* Adiciona um indicador visual na lateral esquerda para o próximo programa */
.epg-item.next-program::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: #ffcc00;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.epg-item.now {
    background-color: #282828; /* Manter o fundo padrão */
    color: #fff;
    font-weight: bold;
    border: none; /* Remover a borda vermelha do item completo */
    box-shadow: none;
}

.epg-item.now p {
    color: #ffffff;
}

.epg-item.now .program-description {
    color: #e6e6e6;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .channel-content {
        flex-direction: row;
        align-items: stretch;
        gap: 0;
        height: 100vh;
    }

    .video-player-container {
        flex: 3; /* Ocupa 75% do espaço */
        max-width: 75%;
        height: 100vh;
        aspect-ratio: auto;
        border-radius: 0;
    }

    .epg-section {
        flex: 1; /* Ocupa 25% do espaço */
        background-color: #1a1a1a; /* Cor de fundo escura */
        padding: 15px;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        aspect-ratio: auto;
        min-width: 250px;
        max-width: 25%;
        height: 100vh;
        overflow-y: auto;
    }

    .epg-list {
        flex-grow: 1; /* Permite que a lista de EPG preencha o espaço restante */
        overflow-y: auto; /* Adiciona scroll se o conteúdo for muito longo */
        padding-right: 5px; /* Espaço para o scrollbar */
        height: calc(100% - 130px); /* Altura calculada para preencher o espaço disponível, considerando o nome do canal */
        min-height: 0; /* Permite que o conteúdo seja exibido completamente */
    }
    
    .epg-list p{
        text-align: center;
    }
}

@media (max-width: 767px) {
    .channel-content {
        flex-direction: column;
        padding: 10px;
        min-height: 100vh;
        height: auto;
    }
    
    .epg-list p{
        text-align: center;
    }
    
    .video-player-container {
        max-width: 100%;
        width: 100%;
        margin-bottom: 20px;
    }
    
    .epg-section {
        max-width: 100%;
        width: 100%;
        min-height: 500px; /* Altura mínima aumentada para mostrar mais conteúdo */
        aspect-ratio: auto; /* Remove a proporção fixa para telas pequenas */
        height: auto; /* Permite que a altura se ajuste ao conteúdo */
        display: flex;
        flex-direction: column;
        overflow: auto; /* Permite rolagem */
    }
    
    .epg-list {
        width: 100%;
        min-width: 220px;
        max-width: 100%;
        height: auto; /* Permite que a altura se ajuste ao conteúdo */
        min-height: 350px; /* Altura mínima aumentada para mostrar mais programas */
        flex-grow: 1; /* Permite que a lista cresça para preencher o espaço disponível */
        overflow-y: auto; /* Permite rolagem vertical */
    }
    
    .epg-item {
        padding: 12px; /* Reduz um pouco o padding para caber mais itens */
        margin-bottom: 6px; /* Reduz o espaço entre os itens */
    }
    
    .epg-item .program-title {
        font-size: 1.1em; /* Tamanho de fonte ajustado para telas pequenas */
    }
    
    .epg-item .time-text {
        font-size: 0.9em; /* Tamanho de fonte menor para o horário */
    }
    
    .epg-item .time-icon {
        font-size: 14px; /* Ícone um pouco menor */
    }
    
    .epg-title {
        font-size: 1.3em; /* Tamanho de fonte ligeiramente menor */
        margin-bottom: 10px; /* Reduz o espaço abaixo do título */
    }
    
    .epg-dropdown {
        margin-bottom: 10px; /* Reduz o espaço abaixo do dropdown */
    }
    
    .channel-name {
        font-size: 1.4em;
        margin-bottom: 10px;
    }
    
    /* Ajustes para o programa atual em telas pequenas */
    .epg-item.current-program {
        padding-top: 12px;
        padding-bottom: 12px;
        min-height: 60px; /* Altura reduzida para telas pequenas */
    }
    
    .epg-item.current-program .program-title {
        font-size: 1.2em; /* Tamanho um pouco maior que os outros itens */
        margin-top: 5px;
    }
    
    .epg-item.current-program .time-container {
        margin-bottom: 6px; /* Espaço reduzido entre o horário e o título */
    }
}

/* Ajustes para telas muito pequenas (smartphones em modo retrato) */
@media (max-width: 480px) {
    .channel-content {
        padding: 5px;
    }
    
    .epg-list p{
        text-align: center;
    }
    
    .video-player-container {
        min-height: 200px;
    }
    
    .epg-section {
        min-height: 500px; /* Altura mínima maior para garantir boa visualização */
        padding: 12px; /* Reduz o padding para aproveitar mais espaço */
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: auto; /* Permite rolagem */
    }
    
    .epg-list {
        min-height: 400px; /* Altura mínima maior para mostrar mais programas */
        flex-grow: 1; /* Permite que a lista cresça para preencher o espaço disponível */
        height: auto; /* Permite que a altura se ajuste ao conteúdo */
        overflow-y: auto; /* Permite rolagem vertical */
    }
    
    .epg-item {
        padding: 10px; /* Padding ainda menor para caber mais itens */
        margin-bottom: 5px; /* Espaço ainda menor entre os itens */
    }
    
    .epg-title {
        font-size: 1.2em; /* Fonte ainda menor */
        padding-left: 8px; /* Reduz o padding do título */
    }
    
    .channel-name {
        font-size: 1.3em;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    
    .container-full {
        padding: 0;
    }
}

/* Modal de Compartilhamento */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #222;
    padding: 30px 20px 20px 20px;
    border-radius: 10px;
    min-width: 300px;
    max-width: 90vw;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    position: relative;
    text-align: center;
}
.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2em;
    color: #e50914;
    cursor: pointer;
}
.share-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}
.share-buttons button {
    background: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 12px 18px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}
.share-facebook { background: #3b5998; }
.share-facebook:hover { background: #2d4373; }
.share-twitter { background: #1da1f2; }
.share-twitter:hover { background: #0d95e8; }
.share-whatsapp { background: #25d366; color: #222; }
.share-whatsapp:hover { background: #128c7e; color: #fff; }