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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #fff;
    overflow-x: hidden;
}

.header {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle-sidebar-header {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-sidebar-header:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

/* Estados do botão baseados na sidebar */
.toggle-sidebar-header.sidebar-open {
    background: rgba(220,53,69,0.2);
    border-color: rgba(220,53,69,0.4);
}

.toggle-sidebar-header.sidebar-open:hover {
    background: rgba(220,53,69,0.3);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.btn.active {
    background: #007bff;
    border-color: #007bff;
}

.main-container {
    display: flex;
    height: calc(100vh - 70px);
}

.sidebar {
    width: 300px;
    background: #1a1a1a;
    border-right: 1px solid #333;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
    min-width: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #333;
}

.category-section {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #007bff;
}

.channel-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.channel-item:hover {
    background: rgba(255,255,255,0.1);
}

.channel-flag {
    width: 24px;
    height: 16px;
    margin-right: 10px;
    border-radius: 2px;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.grid-container {
    flex: 1;
    padding: 20px;
    overflow: auto;
    transition: all 0.3s ease;
}

/* Quando sidebar está collapsed, expandir o grid */
.sidebar.collapsed + .grid-container {
    width: 100%;
    padding: 20px 40px; /* Padding maior nas laterais */
}

.sidebar.collapsed + .grid-container .grid {
    max-width: none; /* Remover limitação de largura máxima */
    width: 100%;
    gap: 20px; /* Gap maior entre players */
}

/* Players maiores quando sidebar collapsed */
.sidebar.collapsed + .grid-container .player-box {
    min-height: 320px; /* Altura maior */
}

.sidebar.collapsed + .grid-container .player-content {
    height: 270px; /* Conteúdo maior */
}

/* Garantir que o vídeo use todo o espaço disponível quando sidebar collapsed */
.sidebar.collapsed + .grid-container .video-js {
    width: 100% !important;
    height: 100% !important;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 100%;
}

.grid.maximized {
    grid-template-columns: 1fr;
}

.player-box {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    position: relative;
    min-height: 280px;
}

.player-box.maximized {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    min-height: calc(100vh - 70px);
    border-radius: 0;
    background: #000;
}

.player-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.player-box.maximized:hover {
    transform: none;
}

.player-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

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

.channel-logo {
    width: 32px;
    height: 32px;
    background: #007bff;
    border-radius: 4px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.channel-name {
    font-weight: 600;
    font-size: 14px;
}

.player-controls {
    display: flex;
    gap: 5px;
}

.control-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 10px;
}

.control-btn:hover {
    background: rgba(255,255,255,0.2);
}

.control-btn.active {
    background: #007bff;
}

.edit-btn {
    background: rgba(255,193,7,0.8);
    color: #000;
}

.edit-btn:hover {
    background: rgba(255,193,7,1);
}

.player-content {
    height: 230px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.player-box.maximized .player-content {
    height: calc(100vh - 120px);
}

.video-js {
    width: 100% !important;
    height: 100% !important;
}

.video-js video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.video-js .vjs-poster {
    background-size: contain !important;
    background-position: center !important;
}

.video-js .vjs-tech {
    object-fit: contain !important;
}

.video-js .vjs-control-bar {
    font-size: 10px;
    height: 25px;
}

.video-js .vjs-big-play-button {
    font-size: 1.2em;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.vjs-default-skin .vjs-control-bar {
    background: rgba(7, 20, 30, 0.9) !important;
}

.vjs-default-skin .vjs-volume-panel {
    width: 4em;
}

.video-placeholder {
    color: #666;
    text-align: center;
    padding: 20px;
}

.status-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc3545;
}

.status-indicator.live {
    background: #28a745;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.audio-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}



.config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.config-modal.active {
    display: flex;
}

.config-content {
    background: #1a1a1a;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #333;
}

.config-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-header h2 {
    color: #007bff;
    font-size: 24px;
}

.config-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.config-body {
    padding: 20px;
}

.config-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
}

.config-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.config-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.config-panel {
    display: none;
}

.config-panel.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #ddd;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 5px;
    color: white;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.channel-list {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.channel-item-config {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #333;
    gap: 10px;
}

.channel-item-config:last-child {
    border-bottom: none;
}

.channel-item-config .channel-name {
    flex: 1;
    font-weight: 600;
}

.channel-item-config .channel-url {
    flex: 2;
    color: #888;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-actions {
    display: flex;
    gap: 5px;
}

.channel-actions button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.edit-channel-btn {
    background: #ffc107;
    color: #000;
}

.delete-channel-btn {
    background: #dc3545;
    color: white;
}

.deactivate-channel-btn {
    background: #fd7e14;
    color: white;
}

.activate-channel-btn {
    background: #28a745;
    color: white;
}

.channel-item-config.inactive {
    opacity: 0.6;
    background-color: #2a2a2a;
}

.channel-item-config.inactive .channel-name {
    color: #999;
}

.config-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #333;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar {
        position: absolute;
        z-index: 999;
        height: 100%;
    }
} 