/* Content Area Styles */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 10px;
    height: 100%;
}

#streams-container {
    display: grid;
    width: 100%;
    gap: 10px;
    min-height: 0;
    align-content: start; /* Permet l'expansion verticale */
}

.player-container {
    background-color: #0e0e10;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    min-height: 0;
    width: 100%;
    height: 100%;
}

/* Ensure iframe maintains aspect ratio */
.player-iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    will-change: opacity;
    aspect-ratio: 16/9;
}

.player-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.player-container:hover .player-controls {
    opacity: 1;
}

.player-controls button {
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.player-controls button:hover {
    background-color: var(--primary-color);
}

/* Tooltips personnalisés pour les boutons des contrôles des players */
.player-controls button {
    position: relative;
}

.player-controls button:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-out forwards;
}



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

/* Empêcher les icônes FontAwesome d'interférer avec les tooltips */
.player-controls button i::before,
.player-controls button i::after {
    position: static !important;
}

/* Zoom styles */
.player-zoomed {
    order: -1;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
    max-height: 70vh; /* Augmenté de 50vh à 70vh pour un player plus grand */
    grid-column: 1 / -1 !important;
    z-index: 5;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    transform: translateZ(0);
}

.player-below-zoomed {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
    max-height: 20vh; /* Réduit de 25vh à 20vh pour équilibrer l'espace */
    grid-column: auto !important;
    transition: all 0.3s ease;
    transform: scale(1) translateZ(0);
}

/* Ajustement du container pour le mode zoom avec 5 colonnes */
#streams-container.zoom-active {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 colonnes pour les players en dessous */
    gap: 5px; /* Réduit de 10px à 5px pour moins d'espace entre les éléments */
    align-items: start;
    grid-auto-flow: row;
    padding-top: 0; /* Supprime tout padding en haut */
    margin-top: 0; /* Supprime toute marge en haut */
}

/* S'assurer que le container principal n'a pas d'espace inutile */
.content {
    padding-top: 5px; /* Réduit le padding du haut */
}