/* Estilos para a página de Canais */

.channels-section {
    padding: 2rem 0 3rem;
}

.channels-section .section-header {
    margin-bottom: 0;
}

.channels-section .section-header h1 {
    font-size: 1.8rem;
}

/* Filtros */
.channels-filters {
    margin: 1.5rem 0 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.search-container {
    flex: 1;
    min-width: 250px;
    display: flex;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 0.65rem 1rem;
    padding-right: 3rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-darker);
    color: var(--text-color);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.search-btn:hover {
    color: var(--primary-color);
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

#category-filter {
    padding: 0.65rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-darker);
    color: var(--text-color);
    font-size: 0.9rem;
    min-width: 180px;
    cursor: pointer;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.toggle-switch.small {
    width: 40px;
    height: 20px;
}

.toggle-switch.small .toggle-slider:before {
    width: 16px;
    height: 16px;
}

/* ========== Grid de Canais ========== */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 0 0 2rem;
}

/* ========== Card do Canal ========== */
.channel-card {
    background: var(--card-bg);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.channel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    border-color: rgba(var(--primary-rgb), 0.3);
}

/* Banner */
.channel-banner {
    width: 100%;
    height: 120px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.channel-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.channel-card:hover .channel-banner img {
    transform: scale(1.05);
}

/* Badge AO VIVO */
.live-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #e50914 0%, #ff2d3a 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 10px rgba(229, 9, 20, 0.5);
    animation: pulse 2s infinite;
    letter-spacing: 0.5px;
}

.live-badge i {
    font-size: 0.85rem;
    animation: blink 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(229, 9, 20, 0.5);
    }
    50% {
        box-shadow: 0 2px 20px rgba(229, 9, 20, 0.8);
    }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Avatar + Info header */
.channel-info {
    display: flex;
    align-items: flex-end;
    padding: 0 1.25rem;
    margin-top: -28px;
    position: relative;
    z-index: 2;
    gap: 0.75rem;
}

.channel-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    border: 3px solid var(--card-bg);
    overflow: hidden;
    position: relative;
    background: var(--card-bg);
    flex-shrink: 0;
}

.channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.status-indicator {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--text-muted);
    bottom: 1px;
    right: 1px;
    border: 2.5px solid var(--card-bg);
}

.status-indicator.online {
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 8px #22c55e; }
    50% { box-shadow: 0 0 16px #22c55e, 0 0 24px rgba(34, 197, 94, 0.3); }
}

/* Nome do canal (ao lado do avatar) */
.channel-info .channel-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-bottom: 4px;
    color: var(--text-color);
}

/* Detalhes do canal */
.channel-details {
    padding: 0.75rem 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.channel-details h3 {
    display: none; /* Escondido pois o nome ficará ao lado do avatar */
}

.channel-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.category {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.category.online-category {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.viewer-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #ef4444;
    font-weight: 600;
}

.status-offline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
}

.backgrounds-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
}

.stream-title {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Descrição */
.channel-description {
    padding: 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    min-height: 2.5rem;
    max-height: 3.8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.channel-description p {
    margin: 0;
}

/* Ações - sempre no fundo do card */
.channel-actions {
    padding: 1rem 1.25rem;
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.channel-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.channel-actions .btn-primary {
    flex: 1;
}

.channel-actions .btn-outline {
    flex: 0 0 auto;
    min-width: auto;
    padding: 0.5rem 0.75rem;
}

/* Estado sem streamers */
.no-streamers {
    grid-column: 1 / -1;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-streamers h3 {
    margin: 0.5rem 0;
    font-size: 1.4rem;
    color: var(--text-color);
}

.no-streamers p {
    color: var(--text-muted);
    font-size: 1rem;
}

.no-results-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Paginação */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* CTA Section */
.channels-cta {
    margin: 0 0 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 14px;
    padding: 3rem 2rem;
    text-align: center;
    color: white;
}

.channels-cta h2 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}

.channels-cta p {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.channels-cta .btn {
    padding: 0.75rem 2rem;
    font-size: 1.05rem;
    background: white;
    color: var(--primary-color);
    border: none;
    font-weight: 700;
    border-radius: 10px;
}

.channels-cta .btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

/* ========== Responsividade ========== */
@media (max-width: 1024px) {
    .channels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .channels-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .channels-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .channel-banner {
        height: 100px;
    }
    
    .channels-cta {
        padding: 2rem 1rem;
    }

    .channels-cta h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .channels-section {
        padding: 1.5rem 0 2rem;
    }

    .channel-actions .btn {
        font-size: 0.78rem;
        padding: 0.45rem 0.6rem;
    }
}