/* =========================================================================
   dashboard.css - CARDS DE MATÉRIAS, GAVETAS & VIDEOAULAS
   Portal do Careca • Prof. Raphael Paulino
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. SEÇÃO PRINCIPAL E GRADE DE MATÉRIAS
   ------------------------------------------------------------------------- */
.secao-dashboard {
    margin-bottom: 2rem;
}

.secao-titulo {
    margin-bottom: 1.25rem;
}

.secao-titulo h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
}

.secao-titulo span {
    font-size: 0.85rem;
    color: var(--text-muted, #94a3b8);
}

.grid-materiais-atuais {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1rem;
}

.col-span-all {
    grid-column: 1 / -1 !important;
}

/* -------------------------------------------------------------------------
   2. CARD DA MATÉRIA / UNIDADE & BADGES DE STATUS
   ------------------------------------------------------------------------- */
.card-materia {
    background: var(--bg-surface, #131b2e);
    border: 1px solid var(--border-color, #23324d);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card-materia:hover {
    transform: translateY(-3px);
}

/* Bordas temáticas no hover */
.card-cor-blue:hover { border-color: var(--brand-blue, #38bdf8); }
.card-cor-violet:hover { border-color: var(--accent-violet, #a855f7); }
.card-cor-emerald:hover { border-color: var(--accent-emerald, #10b981); }

.card-materia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.badge-materia {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
}

.badge-blue { background: rgba(56, 189, 248, 0.15); color: var(--brand-blue, #38bdf8); }
.badge-violet { background: rgba(168, 85, 247, 0.15); color: var(--accent-violet, #a855f7); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald, #10b981); }

.badge-status-atual {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--accent-emerald, #10b981);
    background: rgba(16, 185, 129, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.badge-status-regular {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, #23324d);
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.unidade-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 0.35rem;
}

.card-materia-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.card-materia-body h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-materia-body p {
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

.card-materia-footer {
    border-top: 1px solid var(--border-color, #23324d);
    padding-top: 1rem;
}

.btn-acessar-unidade {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card, #182238);
    border: 1px solid var(--border-color, #23324d);
    border-radius: 8px;
    color: var(--text-primary, #f8fafc);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-acessar-unidade:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--brand-blue, #38bdf8);
    color: var(--brand-blue, #38bdf8);
}

.btn-acessar-unidade .icon-svg {
    width: 16px;
    height: 16px;
}

/* -------------------------------------------------------------------------
   3. BARRA DE AÇÕES DO CARD (MATERIAIS, VÍDEOS, TUTOR, PROJETOR)
   ------------------------------------------------------------------------- */
.card-materia-acoes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #23324d);
    margin-top: auto;
}

.btn-card-acao {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    background: var(--bg-card, #182238);
    border: 1px solid var(--border-color, #23324d);
    border-radius: 8px;
    color: var(--text-primary, #f8fafc);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-card-acao .icon-svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary, #94a3b8);
}

.icon-lucide {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.icon-mini-item {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    flex-shrink: 0;
}

/* Cores e temas dos botões de ação */
.btn-card-materiais .icon-lucide { stroke: var(--accent-amber, #f59e0b); }
.btn-card-videos .icon-lucide { stroke: var(--accent-rose, #f43f5e); }
.btn-card-tutor .icon-lucide { stroke: var(--accent-violet, #a855f7); }
.btn-card-projetor .icon-lucide { stroke: var(--brand-blue, #38bdf8); }

.btn-card-materiais:hover {
    border-color: #f59e0b;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}
.btn-card-videos:hover {
    border-color: #f43f5e;
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.08);
}
.btn-card-tutor:hover {
    border-color: #a855f7;
    color: #a855f7;
    background: rgba(168, 85, 247, 0.08);
}
.btn-card-projetor:hover {
    border-color: #38bdf8;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

/* Destaque ativo com gaveta aberta */
.btn-card-acao.btn-card-ativo.ativo-materiais {
    border: 1.5px solid #f59e0b;
    background: rgba(245, 158, 11, 0.16);
    color: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}
.btn-card-acao.btn-card-ativo.ativo-videos {
    border: 1.5px solid #f43f5e;
    background: rgba(244, 63, 94, 0.16);
    color: #f43f5e;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.35);
}

/* -------------------------------------------------------------------------
   4. GAVETAS EXPANSÍVEIS (ACORDEÃO DE CADERNOS & ARQUIVOS)
   ------------------------------------------------------------------------- */
.gaveta-card {
    margin-top: 12px;
    background: var(--bg-page, #0b0f19);
    border: 1px solid var(--border-color, #23324d);
    border-radius: 8px;
    overflow: hidden;
    animation: fadeInGaveta 0.2s ease-in-out;
}

@keyframes fadeInGaveta {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.gaveta-conteudo {
    padding: 10px 12px;
}

.gaveta-loader, 
.gaveta-vazio {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    text-align: center;
    padding: 8px 0;
}

.gaveta-lista-itens {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Linha de Recurso / Arquivo */
.item-recurso-linha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.item-recurso-linha:hover,
.item-recurso-linha.item-clicavel:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateX(4px);
}

.item-recurso-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 180px;
    min-width: 0;
}

.item-recurso-info strong {
    color: var(--text-primary, #f8fafc);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-recurso-botoes {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.btn-item-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--brand-blue, #38bdf8);
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
    transition: background 0.2s ease;
}

.btn-item-link:hover {
    background: var(--brand-blue, #38bdf8);
    color: #0b0f19;
}

.icon-mini-arrow {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

.btn-link-prof {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald, #10b981);
}

.btn-link-prof:hover {
    background: var(--accent-emerald, #10b981);
    color: #0b0f19;
}

.btn-link-prof-destaque {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald, #10b981);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-link-prof-destaque:hover {
    background: var(--accent-emerald, #10b981);
    color: #0b0f19;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.badge-mini-tipo {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, #94a3b8);
}

.item-indisponivel {
    color: var(--text-muted, #94a3b8);
    font-size: 0.75rem;
}

/* -------------------------------------------------------------------------
   5. CARDS DE VÍDEO (ABA VÍDEOS & LISTA AMPLA)
   ------------------------------------------------------------------------- */
.lista-videos-container {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 0.5rem 0;
}

.card-video-item {
    background: #131b2e;
    border: 1px solid var(--border-color, #23324d);
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
}

.card-video-item:hover {
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.video-item-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.video-badge-trilha {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.video-badge-teoria {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.video-item-autor-tag {
    font-size: 0.75rem;
    color: #64748b;
}

.video-item-titulo {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #f8fafc);
    line-height: 1.35;
    margin: 0;
}

.video-item-caixa-desc {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-left: 3px solid rgba(244, 63, 94, 0.5);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.5;
}

.video-item-caixa-desc strong {
    color: var(--text-primary, #f8fafc);
}

.video-item-rodape {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 2px;
}

.btn-assistir-video {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.35);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-assistir-video:hover {
    background: #f43f5e;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.4);
}

/* -------------------------------------------------------------------------
   6. UTILITÁRIOS GLOBAIS DE LAYOUT DO DASHBOARD
   ------------------------------------------------------------------------- */
.d-none { display: none !important; }
.txt-amber { color: var(--accent-amber, #f59e0b) !important; }

/* -------------------------------------------------------------------------
   7. RESPONSIVIDADE DEDICADA (TELAS <= 600px)
   ------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .card-materia {
        padding: 1.25rem 1rem;
    }

    .card-materia-acoes {
        gap: 6px;
    }

    .btn-card-acao {
        padding: 8px 4px;
        font-size: 0.7rem;
    }

    .btn-card-acao .icon-svg,
    .btn-card-acao .icon-lucide {
        width: 16px;
        height: 16px;
    }

    .item-recurso-linha {
        padding: 8px 10px;
    }

    .item-recurso-info strong {
        font-size: 0.78rem;
    }

    .btn-item-link {
        padding: 4px 8px;
        font-size: 0.72rem;
    }

    .card-video-item {
        padding: 1rem;
    }

    .video-item-titulo {
        font-size: 0.95rem;
    }
}