/* Variáveis CSS para melhor manutenção e performance */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --error-gradient: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #4CAF50;
    --info-color: #2196F3;
    --warning-color: #FF6B35;
    --text-color: #333;
    --bg-white: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --border-radius: 8px;
    --border-radius-lg: 20px;
    --transition: all 0.3s ease;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--primary-gradient);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    padding-top: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

header {
    background: var(--primary-gradient);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    will-change: transform, box-shadow; /* Otimização de performance */
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--success-color);
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: var(--info-color);
    color: white;
}

.btn-secondary:hover {
    background: #0b7dda;
}

.btn-xtream {
    background: var(--warning-color);
    color: white;
}

.btn-xtream:hover {
    background: #e55a2b;
}

.btn-m3upt {
    background: #9C27B0;
    color: white;
}

.btn-m3upt:hover {
    background: #7B1FA2;
}

.btn-rtp {
    background: #E91E63;
    color: white;
}

.btn-rtp:hover {
    background: #C2185B;
}


.url-input {
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    min-width: 300px;
    transition: all 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0; /* Permite que o flex funcione corretamente */
}

.channels-sidebar {
    width: 350px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: visible;
    opacity: 1;
}

.sidebar-header {
    padding: 20px;
    background: white;
    border-bottom: 2px solid #e0e0e0;
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    will-change: border-color, box-shadow; /* Otimização de performance */
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.channels-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: block;
    visibility: visible;
    opacity: 1;
    min-height: 100px;
}

.channels-list::-webkit-scrollbar {
    width: 8px;
}

.channels-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.channels-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.channels-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.channel-item {
    padding: 15px;
    margin-bottom: 8px;
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    will-change: transform, border-color; /* Otimização de performance */
}

.channel-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
    border-color: var(--primary-color);
}

.channel-item.active {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.channel-item h3 {
    font-size: 16px;
    margin-bottom: 5px;
    font-weight: 600;
}

.channel-item p {
    font-size: 12px;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

/* Container para os 3 quadrados de próximos jogos */
.next-matches-container {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0;
    width: 100%;
}

/* Quadrado individual para cada equipa */
.next-match-square {
    flex: 1;
    background: white;
    border-radius: var(--border-radius);
    padding: 15px;
    border: 2px solid #e0e0e0;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    transition: var(--transition);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}

.next-match-square:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

/* Logo da equipa */
.next-match-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 8px;
}

/* Fallback para logo (inicial do clube) */
.next-match-logo-fallback {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
}

/* Container para logos das equipas */
.next-match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

/* Logo individual de cada equipa */
.next-match-team-logo {
    width: 35px;
    height: 35px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Fallback para logo de equipa */
.next-match-team-logo-fallback {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Separador VS */
.next-match-vs {
    font-size: 10px;
    font-weight: 600;
    color: #999;
    padding: 0 4px;
}

/* Bolinha vermelha para jogo em direto */
.next-match-live-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: #ff0000;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.6);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* Border piscando vermelho para jogo em direto */
.next-match-square.next-match-live {
    border-color: #ff0000;
    animation: borderPulse 1.5s ease-in-out infinite;
    position: relative;
}

@keyframes borderPulse {
    0%, 100% {
        border-color: #ff0000;
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
    }
    50% {
        border-color: #ff4444;
        box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.2);
    }
}

/* Data do jogo */
.next-match-date {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 4px;
}

/* Hora do jogo */
.next-match-time {
    font-size: 11px;
    color: #666;
    text-align: center;
    opacity: 0.8;
}

/* Responsive para mobile */
@media (max-width: 768px) {
    .next-matches-container {
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .next-match-square {
        padding: 12px 8px;
        min-height: 70px;
    }
    
    .next-match-logo,
    .next-match-logo-fallback {
        width: 40px;
        height: 40px;
        margin-bottom: 6px;
    }
    
    .next-match-logo-fallback {
        font-size: 20px;
    }
    
    .next-match-teams {
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .next-match-team-logo,
    .next-match-team-logo-fallback {
        width: 28px;
        height: 28px;
    }
    
    .next-match-team-logo-fallback {
        font-size: 14px;
    }
    
    .next-match-vs {
        font-size: 9px;
        padding: 0 3px;
    }
    
    .next-match-live-indicator {
        width: 8px;
        height: 8px;
        top: 6px;
        right: 6px;
    }
    
    .next-match-date {
        font-size: 11px;
    }
    
    .next-match-time {
        font-size: 10px;
    }
}

.player-selector {
    width: 100%;
    padding: 5px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-selector:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.player-selector:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

#playerSelectorButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.btn-player-selector {
    padding: 12px 20px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    min-height: 44px; /* Tamanho mínimo para touch */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex: 1;
    min-width: calc(50% - 4px); /* 2 botões por linha em mobile */
    text-align: center;
}

.btn-player-selector:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.btn-player-selector:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-player-selector.active {
    background: #667eea !important;
    color: white !important;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.player-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    overflow: hidden;
    min-height: 0; /* Permite que o flex funcione corretamente */
}

.video-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    min-height: 0; /* Permite que o flex funcione corretamente */
    width: 100%;
    height: 100%;
}

.empty-player {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.empty-player[style*="display: none"] {
    display: none !important;
}

.empty-player-content {
    text-align: center;
    color: white;
}

.empty-player-content h2 {
    font-size: 64px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .empty-player-content h2 {
        font-size: 48px;
        margin-bottom: 15px;
    }

    .empty-player-content p {
        font-size: 16px;
    }
}

.empty-player-content p {
    font-size: 20px;
    opacity: 0.9;
}

#videoPlayer {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    background: #000;
    object-fit: contain; /* Mantém proporção do vídeo */
    -webkit-playsinline: true; /* iOS inline playback */
    display: none; /* Começar escondido até que um canal seja selecionado */
    will-change: contents; /* Otimização de performance para vídeo */
    position: relative;
    z-index: 2;
}

#videoPlayer[style*="display: none"] {
    display: none !important;
}

/* Container do iframe */
#dlhdPlayerContainer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: #000;
    overflow: hidden;
    z-index: 2;
}

#dlhdPlayerIframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.player-info {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-top: 1px solid #333;
    position: relative;
    z-index: 10;
}

.player-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.player-info p {
    font-size: 12px;
    opacity: 0.7;
    word-break: break-all;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 18px;
}

/* Estilos para elementos que tinham inline styles */
.mobile-menu-btn {
    display: none;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: var(--transition);
}

.close-mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px 10px;
    -webkit-tap-highlight-color: transparent;
}

/* Elementos ocultos por padrão - display controlado via JavaScript */
#playerInfo {
    display: none;
}

#loading {
    display: none;
}

.modal {
    display: none;
}

#httpsWarning {
    display: none;
}

#drmModal {
    display: none;
}

#xtreamModal {
    display: none;
}

#errorModal {
    display: none;
}

#mobileMenuOverlay {
    display: none;
}

.channels-sidebar {
    display: flex;
    visibility: visible;
    opacity: 1;
}

.channels-list {
    display: block;
    visibility: visible;
    opacity: 1;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.3) !important;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    animation: fadeIn 0.3s ease;
}

.close-mobile-menu-btn {
    display: none;
    transition: all 0.3s ease;
}

.close-mobile-menu-btn:active {
    transform: scale(0.9);
    opacity: 0.7;
}

/* Melhorias para Mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-top: 0;
    }

    .container {
        height: calc(100vh - 20px);
        border-radius: 15px;
        max-height: 100vh;
        overflow: hidden;
    }


    .mobile-menu-btn {
        display: block !important;
    }

    .main-content {
        flex-direction: column;
        display: flex !important;
        flex: 1;
        overflow: hidden;
        position: relative;
    }

    .channels-sidebar {
        position: fixed !important;
        top: 0;
        left: -100%;
        width: 85% !important;
        max-width: 400px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-height: 100vh !important;
        z-index: 999 !important;
        background: #f8f9fa !important;
        box-shadow: 2px 0 15px rgba(0,0,0,0.4);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        order: 0;
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: hidden;
    }

    .channels-sidebar.mobile-menu-open {
        left: 0;
    }


    .sidebar-header {
        padding: 20px 15px !important;
        background: white;
        border-bottom: 2px solid #e0e0e0;
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .close-mobile-menu-btn {
        display: block !important;
    }

    .channels-list {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        flex: 1;
        min-height: 150px;
        -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
        padding: 10px 15px !important;
        scrollbar-width: thin;
        scrollbar-color: #667eea #f1f1f1;
    }

    /* Adicionar padding inferior para melhor scroll */
    .channels-list::after {
        content: '';
        display: block;
        height: 20px;
        flex-shrink: 0;
    }

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

    .channels-list::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 3px;
    }

    .player-section {
        order: 1;
        flex: 1;
        width: 100%;
        display: flex;
        flex-direction: column;
        min-height: 0; /* Permite que o flex funcione corretamente */
    }

    .video-container {
        flex: 1;
        min-height: 0; /* Permite que o flex funcione corretamente */
        position: relative;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    #videoPlayer {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
    }

    #dlhdPlayerContainer {
        width: 100%;
        height: 100%;
        position: relative;
    }

    #dlhdPlayerIframe {
        width: 100%;
        height: 100%;
        border: none;
    }

    .player-info {
        padding: 10px 12px !important;
        background: rgba(0, 0, 0, 0.9) !important;
        border-top: 1px solid #333;
        min-height: auto;
        max-height: 35vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 1;
    }

    .player-info h3 {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        word-break: break-word;
        line-height: 1.3;
    }

    /* Quando o menu está aberto, escurecer o conteúdo */
    .main-content.menu-open .player-section {
        opacity: 0.3;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    header {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 15px !important;
        gap: 12px;
    }

    header > div:first-child {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        flex-shrink: 0;
    }

    header h1 {
        font-size: 20px !important;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
    }

    .mobile-menu-btn {
        flex-shrink: 0;
        font-size: 24px !important;
        padding: 10px 14px !important;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header-controls {
        width: 100%;
        flex-direction: row;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-top: 0;
    }

    .mobile-hide {
        display: none !important;
    }

    .mobile-show {
        display: block !important;
    }

    .url-input {
        min-width: 100%;
        width: 100%;
        font-size: 16px; /* Evita zoom no iOS */
    }

    .btn {
        padding: 14px 16px !important;
        font-size: 15px !important;
        min-height: 48px !important; /* Tamanho mínimo para touch */
        border-radius: 10px !important;
        font-weight: 600 !important;
        white-space: nowrap;
        flex: 0 1 auto;
    }

    .header-controls .btn {
        flex: 1 1 auto;
        min-width: calc(50% - 4px);
    }
    
    .btn-xtream {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        font-weight: 600 !important;
    }
    
    .btn-xtream:active {
        transform: scale(0.95);
        opacity: 0.9;
    }

    .sidebar-header {
        padding: 15px;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: white;
        border-bottom: 2px solid #e0e0e0;
    }

    .sidebar-header h2 {
        font-size: 18px;
        display: block !important;
        visibility: visible !important;
    }

    .search-input {
        font-size: 16px !important; /* Evita zoom no iOS */
        padding: 14px !important;
        min-height: 48px;
        border-radius: 10px;
        width: 100%;
    }

    .channel-item {
        padding: 16px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-bottom: 10px !important;
        background: white;
        border-radius: 10px;
        cursor: pointer;
        min-height: 60px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.08);
        transition: all 0.2s ease;
        border: 2px solid transparent;
    }

    .channel-item:active {
        transform: scale(0.98);
        background: #f0f0f0;
    }

    .channel-item h3 {
        font-size: 16px !important;
        display: block !important;
        visibility: visible !important;
        margin-bottom: 6px !important;
        font-weight: 600;
        line-height: 1.3;
    }

    .channel-item p {
        display: block !important;
        visibility: visible !important;
        font-size: 13px !important;
        opacity: 0.7;
        margin: 0;
    }

    .player-info {
        padding: 10px 12px !important;
        max-height: 35vh;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important; /* Permitir scroll vertical sempre */
    }

    .player-info h3 {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }

    #playerSelectorButtons {
        display: flex !important;
        flex-wrap: wrap;
        gap: 6px !important;
        margin-top: 8px !important;
        width: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10;
    }

    .btn-player-selector {
        flex: 1;
        min-width: calc(50% - 3px);
        padding: 8px 12px !important;
        font-size: 12px !important;
        min-height: 36px !important;
        font-weight: 600 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        border-width: 2px !important;
        border-radius: 6px !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }

    .btn-player-selector:active {
        transform: scale(0.97);
        box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    }

    .video-container {
        position: relative;
    }

    #videoPlayer {
        object-fit: contain;
    }

    .empty-player-content h2 {
        font-size: 48px;
    }

    .empty-player-content p {
        font-size: 16px;
    }

    .modal {
        padding: 10px;
        align-items: flex-end; /* Alinhar ao fundo em mobile */
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh;
        margin: 0;
        border-radius: 20px 20px 0 0 !important;
        animation: slideUpMobile 0.3s ease;
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .modal-header {
        padding: 20px 15px !important;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .modal-header h2 {
        font-size: 18px !important;
    }

    .modal-close {
        width: 40px !important;
        height: 40px !important;
        font-size: 28px !important;
        min-width: 40px;
        -webkit-tap-highlight-color: transparent;
    }

    .modal-body {
        padding: 20px 15px !important;
        max-height: calc(90vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .form-group {
        margin-bottom: 20px !important;
    }

    .form-group label {
        font-size: 15px !important;
        margin-bottom: 10px !important;
    }

    .form-group input {
        font-size: 16px !important; /* Evita zoom no iOS */
        padding: 16px !important;
        min-height: 50px;
        border-radius: 10px;
        width: 100%;
    }

    .form-group input[type="checkbox"] {
        min-height: auto;
        width: 24px;
        height: 24px;
        margin-right: 10px;
    }

    .error-actions {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .error-actions .btn {
        width: 100% !important;
        margin: 0 !important;
    }
}

/* Melhorias para telas muito pequenas */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        height: calc(100vh - 10px);
        border-radius: 10px;
    }

    header {
        padding: 10px 12px !important;
    }

    header h1 {
        font-size: 18px !important;
    }

    .mobile-menu-btn {
        font-size: 20px !important;
        padding: 8px 12px !important;
    }

    .channels-sidebar {
        width: 90% !important;
    }

    .channel-item {
        padding: 14px !important;
        min-height: 55px;
    }

    .channel-item h3 {
        font-size: 15px !important;
    }

    .btn {
        font-size: 14px !important;
        padding: 12px 14px !important;
        min-height: 46px !important;
    }

    .header-controls .btn {
        min-width: calc(50% - 4px);
        font-size: 13px !important;
    }

    .player-info {
        padding: 12px !important;
    }

    .player-info h3 {
        font-size: 16px !important;
    }

    .modal-content {
        border-radius: 15px 15px 0 0 !important;
    }

    .modal-header {
        padding: 15px 12px !important;
    }

    .modal-header h2 {
        font-size: 16px !important;
    }

    .modal-body {
        padding: 15px 12px !important;
    }
}

/* Classes utilitárias para estilos inline */
.header-flex {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sidebar-header-flex h2 {
    margin: 0;
}

.modal-header-error {
    background: var(--error-gradient);
}

.error-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.error-actions .btn {
    flex: 1;
}

.https-warning {
    display: none;
    background: var(--error-gradient);
    color: white;
    padding: 15px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.https-warning-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.https-warning-link {
    color: white;
    text-decoration: underline;
    font-weight: bold;
}

.info-box {
    margin-bottom: 20px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--info-color);
}

.info-box strong {
    display: block;
    margin-bottom: 5px;
}

.info-box p {
    margin: 10px 0 0 0;
    font-size: 14px;
}

.warning-box {
    margin-top: 10px;
    padding: 10px;
    background: #fff3cd;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--warning-color);
}

.warning-box small {
    color: #856404;
    display: block;
    margin-bottom: 5px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
}

.configs-list {
    margin-top: 30px;
}

.configs-list h3 {
    font-size: 16px;
    margin-bottom: 15px;
}

.player-selector-buttons {
    margin-top: 10px;
    display: none;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.epg-info {
    margin-top: 10px;
    display: none;
}

.epg-title {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--success-color);
}

.epg-content {
    font-size: 12px;
    opacity: 0.9;
}

.form-group-hidden {
    display: none;
}

.form-group label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group input[type="checkbox"] {
    width: auto;
}

.form-group label + label {
    margin-top: 10px;
}

/* Suporte para orientação landscape em mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .channels-sidebar {
        width: 70% !important;
        max-width: 350px !important;
    }

    .player-section {
        flex: 1;
        min-height: 0;
    }

    .video-container {
        flex: 1;
        min-height: 0;
        width: 100%;
        height: 100%;
    }

    .player-info {
        padding: 10px 15px !important;
    }
}

/* Estilos para seletor de streams de jogos */
#matchStreamSelector {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    margin-top: 10px;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
}

/* Estilos de scrollbar para WebKit (Chrome, Safari, Edge) */
#matchStreamSelector::-webkit-scrollbar {
    width: 6px;
}

#matchStreamSelector::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

#matchStreamSelector::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

#matchStreamSelector::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Mobile: reduzir ainda mais o tamanho do seletor */
@media (max-width: 768px) {
    #matchStreamSelector {
        max-height: 150px !important;
        margin-top: 8px !important;
        gap: 4px !important;
    }
    
    #matchStreamSelector > div:first-child {
        font-size: 10px !important;
        margin-bottom: 4px !important;
    }
}

/* Estilos específicos para aviso HTTPS em mobile */
@media (max-width: 768px) {
    #httpsWarning {
        padding: 12px 15px !important;
        font-size: 13px;
        line-height: 1.4;
    }

    #httpsWarning > div {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: flex-start !important;
    }

    #httpsWarning a {
        display: block;
        margin-top: 8px;
        padding: 8px 12px;
        background: rgba(255,255,255,0.2);
        border-radius: 5px;
        text-align: center;
        width: 100%;
    }

    #closeHttpsWarning {
        width: 100%;
        padding: 10px !important;
        margin-top: 8px;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

/* Proteções contra anúncios durante fullscreen */
:fullscreen [class*="ad"],
:fullscreen [id*="ad"],
:fullscreen [class*="popup"],
:fullscreen [id*="popup"],
:fullscreen [class*="overlay"]:not(#mobileMenuOverlay):not(.modal-content),
:fullscreen [id*="overlay"]:not(#mobileMenuOverlay),
:fullscreen [class*="banner"],
:fullscreen [id*="banner"],
:fullscreen [class*="sponsor"],
:fullscreen [id*="sponsor"],
:-webkit-full-screen [class*="ad"],
:-webkit-full-screen [id*="ad"],
:-webkit-full-screen [class*="popup"],
:-webkit-full-screen [id*="popup"],
:-webkit-full-screen [class*="overlay"]:not(#mobileMenuOverlay):not(.modal-content),
:-webkit-full-screen [id*="overlay"]:not(#mobileMenuOverlay),
:-webkit-full-screen [class*="banner"],
:-webkit-full-screen [id*="banner"],
:-webkit-full-screen [class*="sponsor"],
:-webkit-full-screen [id*="sponsor"],
:-moz-full-screen [class*="ad"],
:-moz-full-screen [id*="ad"],
:-moz-full-screen [class*="popup"],
:-moz-full-screen [id*="popup"],
:-moz-full-screen [class*="overlay"]:not(#mobileMenuOverlay):not(.modal-content),
:-moz-full-screen [id*="overlay"]:not(#mobileMenuOverlay),
:-moz-full-screen [class*="banner"],
:-moz-full-screen [id*="banner"],
:-moz-full-screen [class*="sponsor"],
:-moz-full-screen [id*="sponsor"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Proteção adicional para iframes de anúncios durante fullscreen */
:fullscreen iframe[src*="ad"],
:fullscreen iframe[src*="ads"],
:fullscreen iframe[src*="advertising"],
:-webkit-full-screen iframe[src*="ad"],
:-webkit-full-screen iframe[src*="ads"],
:-webkit-full-screen iframe[src*="advertising"],
:-moz-full-screen iframe[src*="ad"],
:-moz-full-screen iframe[src*="ads"],
:-moz-full-screen iframe[src*="advertising"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Notificação Toast para Mobile */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 12px;
    max-width: 90%;
    animation: toastSlideUp 0.3s ease forwards;
    font-size: 15px;
    font-weight: 500;
}

.toast-notification.show {
    display: flex;
    animation: toastSlideUp 0.3s ease forwards;
}

.toast-notification.hide {
    animation: toastSlideDown 0.3s ease forwards;
}

@keyframes toastSlideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideDown {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

/* Ajustes adicionais para mobile - reduzir espaço do EPG */
@media (max-width: 768px) {
    .epg-info {
        margin-top: 8px !important;
    }

    .epg-title {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }

    .epg-content {
        font-size: 11px !important;
        line-height: 1.4;
    }
}

