/* TV Tribuna YouTube - Frontend Styles */

/* Container Principal */
.tv-tribuna-youtube-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Cabeçalho */
.tv-tribuna-header {
    margin-bottom: 30px;
}

.tv-tribuna-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 3px solid #e50914;
}

.tv-tribuna-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tv-tribuna-icon {
    font-size: 32px;
}

.tv-tribuna-channel-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #ff0000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tv-tribuna-channel-link:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255,0,0,0.3);
}

.youtube-icon {
    font-size: 16px;
}

/* Player Modal */
.tv-tribuna-player {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tv-tribuna-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16/9;
}

.tv-tribuna-close-player {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255,255,255,0.2);
    border: 2px solid #fff;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tv-tribuna-close-player:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.tv-tribuna-player iframe {
    border-radius: 8px;
}

/* Prevenir scroll quando player está aberto */
body.tv-tribuna-player-open {
    overflow: hidden;
}

/* Grade de Vídeos - Layout Grid */
.tv-tribuna-videos.tv-tribuna-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

/* Colunas responsivas */
.tv-tribuna-videos.tv-tribuna-grid.tv-tribuna-cols-2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.tv-tribuna-videos.tv-tribuna-grid.tv-tribuna-cols-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.tv-tribuna-videos.tv-tribuna-grid.tv-tribuna-cols-4 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Layout Lista */
.tv-tribuna-videos.tv-tribuna-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.tv-tribuna-list .tv-tribuna-video-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

/* Item de Vídeo */
.tv-tribuna-video-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tv-tribuna-video-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

/* Thumbnail */
.tv-tribuna-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
}

.tv-tribuna-list .tv-tribuna-thumbnail {
    padding-top: 0;
    height: 100%;
}

.tv-tribuna-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tv-tribuna-video-item:hover .tv-tribuna-thumbnail img {
    transform: scale(1.05);
}

/* Botão Play */
.tv-tribuna-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    transition: all 0.3s ease;
    pointer-events: none;
}

.tv-tribuna-video-item:hover .tv-tribuna-play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Informações do Vídeo */
.tv-tribuna-video-info {
    padding: 15px;
}

.tv-tribuna-video-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tv-tribuna-video-description {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.tv-tribuna-video-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #888;
}

.tv-tribuna-video-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Footer */
.tv-tribuna-footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.tv-tribuna-see-more {
    display: inline-block;
    padding: 12px 30px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tv-tribuna-see-more:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Error Message */
.tv-tribuna-error {
    background: #fee;
    border-left: 4px solid #dc3232;
    padding: 15px 20px;
    color: #dc3232;
    font-weight: 600;
    border-radius: 4px;
    margin: 20px 0;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .tv-tribuna-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tv-tribuna-title {
        font-size: 22px;
    }
    
    .tv-tribuna-videos.tv-tribuna-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .tv-tribuna-list .tv-tribuna-video-item {
        grid-template-columns: 1fr;
    }
    
    .tv-tribuna-player-wrapper {
        aspect-ratio: 16/9;
    }
    
    .tv-tribuna-close-player {
        top: -45px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .tv-tribuna-youtube-container {
        padding: 10px;
    }
    
    .tv-tribuna-title {
        font-size: 18px;
    }
    
    .tv-tribuna-icon {
        font-size: 24px;
    }
    
    .tv-tribuna-video-title {
        font-size: 14px;
    }
    
    .tv-tribuna-player {
        padding: 10px;
    }
}

/* Loading State */
.tv-tribuna-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.tv-tribuna-loading::after {
    content: '⏳';
    display: block;
    font-size: 48px;
    margin-top: 10px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
