/* Import custom font */
@font-face {
    font-family: 'SF Pro';
    src: url('assets/fonts/SF-Pro.ttf') format('truetype');
}

/* Variables CSS */
:root {
    --bg-color: rgba(255, 255, 255, 0.1);
    --bg-blur: 20px;
    --bg-radius: 15px;
    --text-color: rgba(255, 255, 255, 0.9);
    --highlight-color: rgba(255, 255, 255, 0.2);
    --title-size: 1rem;
    --subtitle-size: 0.8rem;
    --transition-duration: 0.3s;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --highlight-shadow: 0 10px 20px rgba(231, 231, 231, 0.5);
    --ticker-color: #f51c53;
}

/* Reset */
body, html {
    background-color: #141414;
    color: var(--text-color);
    font-family: 'SF Pro', sans-serif;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100%;
    background: var(--bg-color);
    backdrop-filter: blur(var(--bg-blur));
    border-radius: 0 var(--bg-radius) var(--bg-radius) 0;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-top: 60px; /* Espace pour la future barre de recherche et le bouton paramètres */
}

.sidebar .logo {
    width: 80%; /* Taille du logo ajustée */
    height: auto;
    max-height: 50px; /* Taille du logo ajustée */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 35px;
}

.sidebar .logo img {
    width: 100%;
    height: auto;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

/* Titre des catégories dans la sidebar */
.sidebar .header-category h5 {
    color: var(--ticker-color);
    font-size: 1rem; /* Taille de police ajustée pour un look moderne */
    font-weight: bold;
    text-align: left;
    margin-bottom: 10px; /* Espace en bas pour séparer du reste du contenu */
}

.sidebar ul li {
    cursor: pointer;
    padding: 5px 5px;
    border-radius: var(--bg-radius);
    position: relative;
    transition: opacity var(--transition-duration);
    color: var(--text-color);
    opacity: 0.7;
    text-align: left; /* Aligner le texte à gauche */
    margin-bottom: 5px; /* Réduire l'espace entre les boutons */
}

.sidebar ul li.active::after {

    content: '';
    position: absolute;
    top: 50%;
    left: -15px; /* Coller au bord gauche de l'écran */
    transform: translateY(-50%);
    width: 3px; /* Réduire la largeur du ticker */
    height: 1em; /* Ajuster la hauteur pour qu'elle corresponde à la taille du texte */
    background-color: var(--ticker-color);
    border-radius: 0 2px 2px 0;
}

.sidebar ul li.active {
    font-weight: bold;
    opacity: 1;
}

.sidebar ul li:hover {
    opacity: 1;
}

/* Language selector */
.language-selector {
    margin-top: auto;
    width: 100%;
    text-align: center;
}

.language-selector select {
    background: var(--bg-color);
    color: var(--text-color);
    border: none;
    padding: 10px;
    border-radius: var(--bg-radius);
    box-shadow: var(--box-shadow);
    transition: background var(--transition-duration);
}

.language-selector select:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content */

/* ...existing code... */

/* Main Content */
main {
    padding: 15px;
    max-width: calc(100% - 270px); /* Adjusted for sidebar width */
    margin-left: 270px; /* Adjusted for sidebar width */
    display: flex;
    justify-content: center; /* Center the grid horizontally */
}

/* Grid ajustée */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    justify-items: center;
    align-self: center;
}

/* Mosaïque des chaînes */
/* Mosaïque des chaînes */
article {
    position: relative;
    width: 300px; /* Taille inchangée */
    height: 200px;
    background: var(--bg-color);
    backdrop-filter: blur(var(--bg-blur));
    border-radius: var(--bg-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    transition: transform var(--transition-duration), box-shadow var(--transition-duration);
    background-size: cover;
    background-position: center;
    margin: 0 auto; /* Center each article */
}

article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    pointer-events: none;
}

article:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Logo */
/* Logo */
article .channel-logo {
    width: 17%;
    object-fit: contain;
    transition: transform var(--transition-duration);
    z-index: 2;
    margin-bottom: 5px; /* Ajouter un espace entre le logo et le titre */
}

/* article .channel-logo.large-logo {
/*    width: 80px; /* Taille plus grande pour certains logos */
/*    height: 80px; /* Taille plus grande pour certains logos */
/*}

/*article .channel-logo.medium-logo {
/*    width: 60px; /* Taille plus grande pour certains logos */
/*    height: 60px; /* Taille plus grande pour certains logos */
/*}

/*article .channel-logo.small-logo {
/*    width: 40px; /* Taille plus petite pour certains logos */
/*    height: 40px; /* Taille plus petite pour certains logos */
/*}*/

article:hover .channel-logo {
    transform: scale(1.1);
}


/* Titre et description */
article .info {
    text-align: center;
    width: 100%;
    padding: 5px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

article .info h2 {
    font-size: var(--title-size);
    margin: 0;
    padding: 5px;
    line-height: 1.2;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

article .info p {
    font-size: var(--subtitle-size);
    margin: 5px 0 0;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: var(--highlight-shadow);
}

/* Progress bar */
article .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 3;
}

article .progress-bar div {
    height: 100%;
    background: var(--ticker-color);
    width: 0;
    transition: width var(--transition-duration);
}

.popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-color);
    backdrop-filter: blur(var(--bg-blur));
    border-radius: var(--bg-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    padding: 10px;
    z-index: 1000;
    animation: fadeInOut 3s forwards;
}

.popup-logo {
    width: 15%;
    height: auto;
    margin-right: 10px;
}

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

.popup-info strong {
    font-size: var(--title-size);
    margin-bottom: 5px;
}

.popup-progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 5px;
}

.popup-progress {
    height: 100%;
    background: var(--ticker-color);
    width: 0;
    transition: width var(--transition-duration);
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* Responsive */
/* Responsive */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    article {
        width: 120px;
        height: 120px;
    }

    article .channel-logo {
        width: 30px; /* Ajuster la taille du logo pour les petits écrans */
        height: 30px; /* Ajuster la taille du logo pour les petits écrans */
    }

    article .info h2 {
        font-size: 0.8rem;
    }

    article .info p {
        font-size: 0.7rem;
    }
}

#loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: var(--bg-radius);
    box-shadow: var(--box-shadow);
    z-index: 1000;
}

#loading-indicator .spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--ticker-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

#loading-indicator p {
    margin-top: 10px;
    color: var(--text-color);
    font-size: 1rem;
}

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

.video-player-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#video-player {
    width: 80%;
    height: 80%;
}

#close-player {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
}