/* Grille des stations */
.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.1rem;
}

.station-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.station-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.station-card.playing {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--surface), rgba(16, 185, 129, 0.1));
}

.station-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--surface), rgba(37, 99, 235, 0.1));
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.station-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.station-card:hover .station-icon {
    transform: scale(1.1);
}

.station-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.station-category {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--surface-light);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    display: inline-block;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

/* Couleurs de bordure par catégorie musicale */
.station-card .station-category {
    border-color: var(--border);
}

/* Genres électroniques */
.station-card[data-category="electro"] .station-category,
.station-card[data-category="electro-house"] .station-category,
.station-card[data-category="dance-electro"] .station-category {
    border-color: #667eea;
    background: linear-gradient(135deg, var(--surface-light), rgba(102, 126, 234, 0.1));
}

/* Genres metal */
.station-card[data-category="metal"] .station-category,
.station-card[data-category="heavy-metal"] .station-category,
.station-card[data-category="death-metal"] .station-category {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, var(--surface-light), rgba(255, 107, 107, 0.1));
}

/* Jazz */
.station-card[data-category="jazz"] .station-category,
.station-card[data-category="jazz-smooth"] .station-category {
    border-color: #f5576c;
    background: linear-gradient(135deg, var(--surface-light), rgba(245, 87, 108, 0.1));
}

/* Rock */
.station-card[data-category="rock"] .station-category,
.station-card[data-category="rock-pop"] .station-category,
.station-card[data-category="rock-alternatif"] .station-category {
    border-color: #ff9a9e;
    background: linear-gradient(135deg, var(--surface-light), rgba(255, 154, 158, 0.1));
}

/* Rap & Hip-Hop */
.station-card[data-category="rap-rnb"] .station-category,
.station-card[data-category="hip-hop"] .station-category {
    border-color: #a8edea;
    background: linear-gradient(135deg, var(--surface-light), rgba(168, 237, 234, 0.1));
}

/* Pop */
.station-card[data-category="pop-hits"] .station-category,
.station-card[data-category="pop-rock"] .station-category,
.station-card[data-category="vocal-pop"] .station-category {
    border-color: #fcb69f;
    background: linear-gradient(135deg, var(--surface-light), rgba(252, 182, 159, 0.1));
}

/* Éclectique */
.station-card[data-category="eclectique"] .station-category {
    border-color: #fecfef;
    background: linear-gradient(135deg, var(--surface-light), rgba(254, 207, 239, 0.1));
}

/* Humour */
.station-card[data-category="humour"] .station-category {
    border-color: #fab1a0;
    background: linear-gradient(135deg, var(--surface-light), rgba(250, 177, 160, 0.1));
}

/* Années 80-90 */
.station-card[data-category="80s-90s"] .station-category {
    border-color: #fdcb6e;
    background: linear-gradient(135deg, var(--surface-light), rgba(253, 203, 110, 0.1));
}

/* Musique générale */
.station-card[data-category="musique"] .station-category,
.station-card[data-category="music"] .station-category {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, var(--surface-light), rgba(139, 92, 246, 0.1));
}

/* Information */
.station-card[data-category="info"] .station-category {
    border-color: #3b82f6;
    background: linear-gradient(135deg, var(--surface-light), rgba(59, 130, 246, 0.1));
}

/* Sport */
.station-card[data-category="sport"] .station-category {
    border-color: #10b981;
    background: linear-gradient(135deg, var(--surface-light), rgba(16, 185, 129, 0.1));
}

/* Culture */
.station-card[data-category="culture"] .station-category {
    border-color: #f59e0b;
    background: linear-gradient(135deg, var(--surface-light), rgba(245, 158, 11, 0.1));
}

/* Jeunesse */
.station-card[data-category="jeunesse"] .station-category {
    border-color: #ec4899;
    background: linear-gradient(135deg, var(--surface-light), rgba(236, 72, 153, 0.1));
}

/* Généraliste */
.station-card[data-category="generaliste"] .station-category {
    border-color: #6b7280;
    background: linear-gradient(135deg, var(--surface-light), rgba(107, 114, 128, 0.1));
}

/* Documentaire */
.station-card[data-category="documentaire"] .station-category {
    border-color: #84cc16;
    background: linear-gradient(135deg, var(--surface-light), rgba(132, 204, 22, 0.1));
}

/* Divertissement */
.station-card[data-category="divertissement"] .station-category {
    border-color: #ef4444;
    background: linear-gradient(135deg, var(--surface-light), rgba(239, 68, 68, 0.1));
}

.favorite-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--warning);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.share-btn {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 0;
}

.station-card:hover .share-btn {
    opacity: 1;
}

.share-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--success);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    animation: playButtonPulse 2s infinite;
}

.play-btn:hover {
    background: #059669;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.6);
}

@keyframes playButtonPulse {
    0% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }

    50% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.8), 0 0 0 8px rgba(16, 185, 129, 0.1);
    }

    100% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }
}

.playing-indicator {
    position: absolute;
    top: 0.75rem;
    left: 3rem;
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Catégories avec couleurs */
.station-icon.musique,
.station-icon.music {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.station-icon.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.station-icon.sport {
    background: linear-gradient(135deg, #10b981, #059669);
}

.station-icon.culture {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.station-icon.jeunesse {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.station-icon.generaliste {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.station-icon.documentaire {
    background: linear-gradient(135deg, #84cc16, #65a30d);
}

.station-icon.divertissement {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Miniatures YouTube */
.station-icon.youtube-thumbnail {
    background: none;
    border: 2px solid var(--border);
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 33%;
}

.youtube-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.station-card:hover .youtube-thumb-img {
    transform: scale(1.05);
}

/* Overlay pour les miniatures YouTube */
.station-icon.youtube-thumbnail::after {
    content: '▶️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.station-card:hover .station-icon.youtube-thumbnail::after {
    opacity: 1;
}

/* États de chargement */
.station-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.station-card.error {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--surface), rgba(239, 68, 68, 0.1));
}

/* Filtres de catégories */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.category-filter-btn {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.7rem;
    white-space: nowrap;
}

.category-filter-btn:hover {
    color: var(--text);
    border-color: var(--border-light);
    background: var(--surface);
}

.category-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Liste déroulante pour mobile */
.category-filters-dropdown {
    display: none;
    position: relative;
    margin-bottom: 2rem;
}

.category-dropdown-toggle {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.category-dropdown-toggle:hover {
    border-color: var(--border-light);
    background: var(--surface-light);
}

.category-dropdown-toggle.open {
    border-color: var(--primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.category-dropdown-arrow {
    transition: transform 0.2s;
}

.category-dropdown-toggle.open .category-dropdown-arrow {
    transform: rotate(180deg);
}

.category-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--primary);
    border-top: none;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.category-dropdown-menu.open {
    display: block;
}

.category-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border);
}

.category-dropdown-item:last-child {
    border-bottom: none;
}

.category-dropdown-item:hover {
    background: var(--surface-light);
}

.category-dropdown-item.active {
    background: linear-gradient(135deg, var(--surface-light), rgba(37, 99, 235, 0.1));
}

.category-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.category-dropdown-item.active .category-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.category-checkbox-check {
    display: none;
    color: white;
    font-size: 0.75rem;
}

.category-dropdown-item.active .category-checkbox-check {
    display: block;
}

.category-dropdown-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-dropdown-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-light);
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
}

/* Sections de catégories */
.category-section {
    margin-bottom: 4rem;
}

.category-section.hidden {
    display: none;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-icon {
    font-size: 1.25rem;
}

.category-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--surface-light);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 400;
}

/* Indicateur de qualité */
.quality-badge {
    position: absolute;
    top: 0.75rem;
    right: 2.75rem;
    background: var(--surface-light);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.quality-badge.hd {
    background: var(--success);
    color: white;
}

.quality-badge.fhd {
    background: var(--primary);
    color: white;
}

.quality-badge.uhd,
.quality-badge[class*="4k"] {
    background: var(--warning);
    color: white;
}

/* Messages */
.no-stations {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
    font-size: 1.125rem;
}

.loading-message {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.error-message {
    position: fixed;
    top: 110px;
    right: 20px;
    background: var(--danger);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-width: 400px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.error-message.show {
    transform: translateX(0);
    opacity: 1;
}

/* Styles pour les erreurs vidéo */
.video-error-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.video-error-overlay h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

.video-error-overlay p {
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
}

.video-error-overlay button {
    background: white;
    color: var(--danger);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.video-error-overlay button:hover {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
    .stations-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .station-card {
        padding: 1rem;
    }

    .station-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .station-name {
        font-size: 0.875rem;
    }

    /* Masquer les filtres en ligne sur mobile */
    .category-filters {
        display: none;
    }

    /* Afficher la liste déroulante sur mobile */
    .category-filters-dropdown {
        display: block;
    }

    .category-title {
        font-size: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .quality-badge {
        right: 0.75rem;
        top: 0.75rem;
        font-size: 0.6875rem;
        padding: 0.1875rem 0.375rem;
    }

    .favorite-badge {
        width: 18px;
        height: 18px;
        font-size: 0.6875rem;
    }
}

/* B
outon d'action alternative pour Mixed Content */
.mixed-content-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.mixed-content-error h4 {
    color: var(--danger);
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.mixed-content-error p {
    color: var(--text-muted);
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.mixed-content-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.action-btn.secondary:hover {
    background: var(--surface);
    border-color: var(--border-light);
}

.action-btn.danger {
    background: var(--danger);
}

.action-btn.danger:hover {
    background: #dc2626;
}

/* Badge d'avertissement Mixed Content */
.mixed-content-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--warning);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 10;
}

.station-card.mixed-content {
    border-color: var(--warning);
    background: linear-gradient(135deg, var(--surface), rgba(245, 158, 11, 0.1));
}

.station-card.mixed-content:hover {
    border-color: var(--warning);
}

/* Responsive pour les actions Mixed Content */
@media (max-width: 768px) {
    .mixed-content-actions {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }

    .mixed-content-badge {
        font-size: 0.625rem;
        padding: 0.1875rem 0.375rem;
    }

    /* Miniatures YouTube responsive */
    .station-icon.youtube-thumbnail::after {
        width: 20px;
        height: 20px;
        font-size: 0.6875rem;
    }
}