/* General */

* {
    margin: 0;
    padding: 0;
    border: none;
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

body {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    display: flex;
    flex-direction: row;
    height: 100%;
    flex-grow: 1;
}

h2 {
    font-size: 14px;
}

/* Sidebar Toggle Button */

.sidebar-toggle {
    display: none;
    /* Esconde o botão por padrão */
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: #3F2FC3;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 1001;
}

.sidebar-toggle:hover {
    background-color: #3f2fc3cc;
}

/* Sidebar */
/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #3F2FC3, #01F2B2);
    color: #fff;
}

#lateral {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    margin-right: 24px;
    height: 100%;
    padding: 28px 22px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: linear-gradient(135deg, #3F2FC3, #01F2B2);
    box-shadow: 0 22px 48px rgba(17, 17, 17, 0.25);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

#lateral:hover {
    box-shadow: 0 32px 72px rgba(17, 17, 17, 0.35);
    transform: translateY(-2px);
}

#lateral-content {
    padding: 0;
    color: #ffffff;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#lateral-content ul {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

ul {
    list-style-type: none;
}

#lateral-content li {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

#lateral-content li:hover,
#lateral-content li:focus-within,
#lateral-content li.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.25);
}

#lateral-content a {
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    transition: color 0.3s ease;
}

#lateral-content a:hover {
    color: #01F2B2;
}

#lateral-content form {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* centraliza tudo na horizontal */
}

/* Buttons */

#lateral-content button {
    display: inline-block;
    /* geralmente já é, mas assim garante */
    margin-top: auto;
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 14px 20px;
    cursor: pointer;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

#lateral-content button:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
}

#lateral-content button:active {
    transform: translateY(0);
    filter: brightness(0.9);
}

#lateral-content button p {
    font-size: 15px;
    color: inherit;
    font-weight: 600;
}

/* Main */

#principal {
    flex: 1;
    background-color: rgb(231, 231, 231);
    padding: 20px;
    overflow-y: auto;
    border-radius: 25px;
}

/* Session */

.session {
    padding: 25px;
    background-color: white;
    border-radius: 15px;
    margin-bottom: 20px;
}

/* Sessions */

#AlunosContent,
#ForumContent,
#NotificacoesContent {

    /* =======================
   Layout de módulos/preview
   (reuso da página de pagamento)
   ======================= */
    .preview-container {
        max-width: 900px;
        margin: 40px auto;
        padding: 20px;
    }

    .modules-section {
        background: white;
        border-radius: 16px;
        padding: 32px;
        margin-bottom: 24px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .modules-section h2 {
        font-size: 22px;
        font-weight: 600;
        margin-bottom: 24px;
        padding-bottom: 12px;
        border-bottom: 2px solid #3F2FC3;
        color: #333;
    }

    .module-card {
        background: linear-gradient(135deg, #ffffff, #f8f9fa);
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 20px;
        transition: all 0.3s ease;
    }

    .module-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    }

    .module-title {
        font-size: 18px;
        font-weight: 600;
        color: #3F2FC3;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .module-icon {
        display: inline-block;
        width: 28px;
        height: 28px;
        background: linear-gradient(135deg, #3F2FC3, #01F2B2);
        border-radius: 6px;
        text-align: center;
        line-height: 28px;
        color: white;
        font-size: 14px;
        font-weight: 700;
    }

    .lessons-list {
        margin-top: 16px;
        padding-left: 40px;
    }

    .lesson-item {
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
        color: #555;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .lesson-item:last-child {
        border-bottom: none;
    }

    .lesson-icon {
        color: #01F2B2;
        font-size: 12px;
    }

    .empty-state {
        text-align: center;
        padding: 40px;
        color: #999;
        font-size: 15px;
    }

    @media (max-width: 768px) {
        .preview-container {
            margin: 20px auto;
            padding: 15px;
        }

        .modules-section {
            padding: 20px;
        }

        .lessons-list {
            padding-left: 20px;
        }
    }

    display: none;
}

/* CSS para popups */

#CursoPopup,
#UpdatePopup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 300px;
    text-align: center;
    flex-direction: column;
}

.course-form {
    display: flex;
    flex-direction: column;
}

label {
    padding: 10px 0;
}

input,
textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s;
}

input:hover,
textarea:hover,
input:focus,
textarea:focus {
    border-color: #555;
}

button {
    margin: 10px;
    padding: 10px 20px;
    background-color: #555;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    outline: none;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #333;
}

/* Overlay */

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/*     */

/* CursoContent - CardsCurso */


.cardCurso-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px;
    border: 2px solid rgba(114, 103, 103, 0.645);
    border-radius: 10px;
}

.cardCurso {
    width: 200px;
    height: 150px;
    background-color: #01F2B2;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cardCurso p {
    font-size: 20px;
    margin-bottom: 10px;
}

.cardCurso button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cardCurso button:hover {
    background-color: #0056b3;
}

/* =============================================================
   NOVO ESTILO HOME DESKTOP ALINHADO AO MOBILE
   Comentário: Mantém identidade visual (gradientes, botões, cards)
   similar à versão mobile (home_mobile.css) para consistência.
   ============================================================= */

/* Seção container */
.home-section {
    margin-bottom: 50px;
}

.home-section h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3F2FC3;
    /* Cor usada também no mobile */
    color: #333;
}

/* Container de cards com grid para melhor aproveitamento no desktop */
.home-section .cardCurso-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 24px;
    padding: 10px 0;
    border: none;
    /* Remove borda antiga para ficar mais clean */
}

/* Card alinhado ao visual mobile (fundo claro + leve sombra + transição)
   CORREÇÃO: Adicionado align-items: center para centralizar horizontalmente
   o conteúdo do card (título e botão). Antes estava text-align: left sem
   align-items, fazendo os elementos flexbox ficarem alinhados à esquerda.
   Agora text-align: center garante centralização do texto do título e botão. */
.home-section .cardCurso {
    width: 100%;
    height: auto;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    padding: 18px 16px;
    text-align: center;
    /* Centraliza texto do título */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Distribui espaço entre título e botão */
    align-items: center;
    /* CRÍTICO: Centraliza horizontalmente os flex items */
    gap: 1rem;
    /* Espaçamento consistente entre título e form */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all .3s ease;
}

.home-section .cardCurso:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.home-section .course-name {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
    /* Remove margin-bottom pois gap do pai já controla */
    width: 100%;
    /* Garante que o título ocupe toda largura */
}

/* Form ocupa largura total e centraliza seu conteúdo (botão)
   CORREÇÃO: Antes o form tinha apenas margin: 0, sem display flex,
   fazendo o botão não centralizar mesmo com width 100% no button.
   Agora com display flex + justify-content center, o botão fica perfeitamente centralizado. */
.home-section .cardCurso form {
    margin: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    /* Centraliza o botão dentro do form */
}

/* Botões harmonizados com versão mobile
   CORREÇÃO: Adicionado display: block e margin: 0 auto como fallback.
   O width: 100% já estava correto, mas sem display block explícito
   alguns navegadores podem tratar como inline-block, quebrando centralização.
   margin: 0 auto garante centralização horizontal adicional. */
.home-section .cardCurso button,
.btn-access,
.btn-free,
.btn-buy,
.btn-paid {
    /* .btn-paid alias se quiser usar nomenclatura diferente */
    display: block;
    /* Garante comportamento de bloco */
    width: 100%;
    padding: 12px 18px;
    margin: 0 auto;
    /* Centralização horizontal como fallback */
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    color: #fff;
}

/* Acessar curso (gradiente principal da paleta mobile) */
.btn-access {
    background: linear-gradient(135deg, #3F2FC3, #01F2B2);
}

.btn-access:hover {
    filter: brightness(1.05);
}

.btn-access:active {
    transform: scale(.97);
}

/* Curso gratuito */
.btn-free {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.btn-free:hover {
    filter: brightness(1.05);
}

.btn-free:active {
    transform: scale(.97);
}

/* Curso pago / comprar */
.btn-buy,
.btn-paid {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
}

.btn-buy:hover,
.btn-paid:hover {
    filter: brightness(1.05);
}

.btn-buy:active,
.btn-paid:active {
    transform: scale(.97);
}

/* Comentário: As classes acima replicam a paleta e comportamento
   (hover/active) da versão mobile para a Home desktop. */

/* Responsivo: quebra para duas colunas em telas médias */
@media (max-width: 920px) {
    .home-section .cardCurso-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 600px) {
    .home-section h2 {
        font-size: 19px;
    }

    .home-section .course-name {
        font-size: 16px;
    }

    .home-section .cardCurso {
        padding: 16px 14px;
    }
}

#editAlunos {
    display: none;
}

.createCourse {
    padding: 10px;
}

/* Forum Específico */
.topic-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #000000;
}

.topic-meta strong {
    color: #000000;
}

/* Só as topic-meta que estão dentro dos cards do fórum */
.cardCurso .topic-meta {
    margin-top: 6px;
    font-size: 13px;
    color: #555;
}

.cardCurso .topic-meta span {
    display: block;
    /* um abaixo do outro */
    margin-bottom: 2px;
    /* espacinho entre eles */
}

.cardCurso-container.topic-list {
    width: 85%;
    margin: 0 auto;
    /* centraliza */
    width: 85%;
    margin: 0 auto;
    /* centraliza */
    display: flex;
    /* garante que não use o grid/flex padrão dos outros */
    flex-direction: column;
    /* uma coluna só */
    gap: 8px;
    /* espaçamento entre os cards */
}

/* Os cards dentro dessa lista ocupam 100% da largura disponível */
.cardCurso-container.topic-list .cardCurso {
    width: 100%;
    padding: 10px 14px;
    /* se já tiver padding grande, isso reduz */
}



.topic-content {
    margin-top: 8px;
    color: #d0d0d0;
    font-size: 14px;
}

.post-item {
    background: linear-gradient(135deg, rgba(63, 47, 195, 0.1), rgba(1, 242, 178, 0.05));
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.post-author {
    font-weight: bold;
    color: #01F2B2;
}

.post-date {
    color: #a0a0a0;
}

.post-content {
    color: #e0e0e0;
    line-height: 1.6;
}

.reply-form {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(63, 47, 195, 0.1), rgba(1, 242, 178, 0.05));
    border-radius: 10px;
}

.reply-form textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(1, 242, 178, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.reply-form textarea:focus {
    outline: none;
    border-color: #01F2B2;
}

.badge-vip {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

/* Modificadores de botões */
.btn-access[style*="width:auto"],
.btn-access[style*="display:inline-block"] {
    display: inline-block !important;
    width: auto !important;
}

#tittleCursoContent {
    padding: 10px;
    font-size: 18px;
}

/* Responsividade */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }

    #lateral {
        display: none;
        /* Oculta a sidebar por padrão em telas menores */
        width: 100%;
        height: auto;
        margin-right: 0;
        margin-bottom: 0;
        /* Remove margem inferior */
    }

    #principal {
        width: 100%;
        height: auto;
        padding-top: 60px;
        /* Adiciona espaço para o botão "Menu" */
    }

    .sidebar-toggle {
        display: block;
        /* Exibe o botão de alternância em telas menores */
    }

    #lateral-content {
        align-items: center;
        text-align: center;
    }


}

/* tópicos forum */

.topic-header {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.topic-title {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.topic-title h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.topic-meta {
    font-size: 14px;
    color: #000000;
    margin-bottom: 15px;
}

.topic-content {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    line-height: 1.6;
    margin-bottom: 30px;
}

.posts-section {
    margin-top: 40px;
}

.post-item {
    background: #fafafa;
    padding: 15px;
    border-left: 3px solid #2196F3;
    margin-bottom: 15px;
    border-radius: 4px;
}

.post-author {
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 5px;
}

.post-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.post-content {
    line-height: 1.5;
    color: #333;
}

.reply-form {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 6px;
    margin-top: 30px;
}

.btn-back {
    display: inline-block;
    padding: 10px 20px;
    background: #666;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 20px;
}

.btn-back:hover {
    background: #555;
}

.btn-submit {
    padding: 10px 20px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
}

.btn-submit:hover {
    background: #45a049;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
}

.badge-pinned {
    background: #ff9800;
    color: #fff;
}

.badge-locked {
    background: #999;
    color: #fff;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Layout de detalhe único de eBook reaproveitando o mesmo card/cores da Home */
.ebook-detail {
    max-width: 960px;
    margin: 0 auto;
}

.ebook-detail-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 28px;
    display: flex;
    gap: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.ebook-detail-media {
    flex: 1;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
}

.ebook-detail-media img {
    width: 100%;
    height: auto;
    display: block;
}

.ebook-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
}

.ebook-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 900px) {
    .ebook-detail-card {
        flex-direction: column;
    }
}

/* Lista de tópicos do fórum (escopo específico) */
.cardCurso-container.topic-list {
    width: 85%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cardCurso-container.topic-list .topic-card {
    width: 100%;
    padding: 10px 14px;
}

.cardCurso-container.topic-list .topic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 👈 era flex-start */
    gap: 12px;
    text-align: inherit;
}

.cardCurso-container.topic-list .course-name {
    margin: 0;
    font-size: 16px;
    flex: 1;
}

.cardCurso-container.topic-list .topic-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 13px;
    color: #555;
    gap: 2px;
}

.cardCurso-container.topic-list .topic-info span {
    margin: 0;
    padding: 0;
}

/* Responsivo simples para telas menores */
@media (max-width: 768px) {
    .cardCurso-container.topic-list {
        width: 100%;
    }

    .cardCurso-container.topic-list .topic-row {
        flex-direction: column;
        gap: 6px;
    }

    .cardCurso-container.topic-list .topic-info {
        align-items: flex-start;
    }
}

/* Modal de resposta do fórum */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.349);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    color: #333;
    margin-top: 0;
}

.modal-content label {
    color: #333;
}

.ebook-detail-description {
    display: none;
    font-size: 15px;
    color: #0d0d0d;
    font-weight: 500;
    margin-bottom: 12px;
}

#ebookSummaryModal .ebook-summary-modal {
    max-width: 520px;
    width: 92%;
    padding: 24px;
    background: rgb(255, 255, 255);
    border-left: 4px solid #01F2B2;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
    color: #000;
}

.ebook-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.ebook-summary-header h3 {
    margin: 0;
    font-size: 20px;
    color: #000;
}

.ebook-summary-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: #000;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.ebook-summary-close:hover {
    background: rgba(255, 255, 255, 0.6);
}

.ebook-summary-panel {
    max-height: 60vh;
    overflow-y: auto;
}

.ebook-summary-list {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 15px;
    line-height: 1.6;
    color: #000;
}

/* Responsivo modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* Escopo APENAS da lista de tópicos do fórum */
.cardCurso-container.topic-list {
    width: 85%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Cada card de tópico */
.cardCurso-container.topic-list .cardCurso,
.cardCurso-container.topic-list .topic-card {
    display: block;
    /* garante bloco normal, não flex herdado estranho */
    text-align: left;
    /* desliga centralização herdada */
    padding: 10px 14px;
}

/* Remove sublinhado só nos cards de tópicos do fórum */
.cardCurso-container.topic-list .cardCurso {
    text-decoration: none;
}

/* Garante que nada dentro do card herde sublinhado */
.cardCurso-container.topic-list .cardCurso * {
    text-decoration: none;
}