/* ============================================= */
/* MÓDULO DE TREINAMENTO OBRIGATÓRIO (treinamento.css) */
/* ============================================= */

.treinamento-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header do Treinamento */
.treinamento-header {
    background: #002888;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.treinamento-header .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.treinamento-header .user-info img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #F6DB17;
}

.treinamento-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.treinamento-header .progress-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 200px;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #F6DB17;
    width: 0%;
    transition: width 0.4s ease;
}

@media (max-width: 640px) {
    .treinamento-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 14px 18px;
    }
    
    .treinamento-header-right {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }
    
    .treinamento-header .progress-box {
        width: 100%;
        align-items: flex-start;
        min-width: 0;
    }
}

/* Layout Principal: Player + Playlist */
.treinamento-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

@media (max-width: 992px) {
    .treinamento-grid {
        grid-template-columns: 1fr;
    }
}

/* Area do Player */
.player-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000000;
    border-radius: 8px;
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Controles Customizados do Vídeo */
.video-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #001f5b;
    padding: 10px 16px;
    border-radius: 0 0 8px 8px;
    color: #ffffff;
    margin-top: -4px;
}

.video-controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-ctrl {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-ctrl:hover {
    background: rgba(255,255,255,0.2);
}

/* Título e Ações da Aula */
.aula-header-info {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.aula-header-info h2 {
    font-size: 1.25rem;
    color: #002888;
    margin: 0;
    font-weight: 700;
}

.aula-reactions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-reaction {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reaction:hover {
    background: #e2e8f0;
}

.btn-reaction.active-like {
    background: #dcfce7;
    border-color: #22c55e;
    color: #15803d;
}

.btn-reaction.active-deslike {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

/* Playlist Lateral */
.playlist-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    max-height: 680px;
}

.playlist-wrapper h3 {
    font-size: 1.1rem;
    color: #002888;
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: 700;
    border-bottom: 2px solid #F6DB17;
    padding-bottom: 8px;
}

.playlist-items {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.playlist-item:hover:not(.locked) {
    background: #e0f2fe;
    border-color: #38bdf8;
}

.playlist-item.active {
    background: #002888;
    color: #ffffff;
    border-color: #002888;
}

.playlist-item.active .item-title {
    color: #ffffff;
}

.playlist-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f1f5f9;
}

.item-status-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
    flex: 1;
}

/* Seção de Comentários */
.comentarios-section {
    margin-top: 24px;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.comentarios-section h3 {
    font-size: 1.1rem;
    color: #002888;
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: 700;
}

.form-comentario {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.form-comentario textarea {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 50px;
}

.form-comentario button {
    background: #002888;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.form-comentario button:hover {
    background: #001f5b;
}

.lista-comentarios {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comentario-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    border-left: 4px solid #002888;
}

.comentario-author {
    font-weight: 700;
    font-size: 0.85rem;
    color: #0f172a;
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comentario-date {
    font-weight: 400;
    color: #64748b;
    font-size: 0.75rem;
}

.comentario-text {
    font-size: 0.9rem;
    color: #334155;
    margin: 0;
}

/* Modal Parabéns / Conclusão 100% */
.modal-conclusao-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 40, 136, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.modal-conclusao-card {
    background: #ffffff;
    padding: 32px;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    animation: popIn 0.4s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-conclusao-card h2 {
    color: #002888;
    margin-top: 12px;
}

.modal-conclusao-card p {
    color: #475569;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-modal-concluir {
    background: #22c55e;
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 16px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}
