/* =========================================
   1. ESTILO BASE (MODO CLARO / PADRÃO)
   ========================================= */

/* --- LAYOUT GERAL --- */
.mn-glossary-container {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    color: #333333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

/* --- LISTA A-Z PREMIUM (Grelha de Cartões) --- */

/* Letras de Cabeçalho (A, B, C...) */
.mn-glossary-letter-section h3 {
    font-size: 2.5em !important;
    font-weight: 800;
    color: #e0e0e0;
    margin: 40px 0 20px 0;
    position: relative;
    padding-left: 15px;
    line-height: 1;
}

.mn-glossary-letter-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 6px;
    background: #d63638;
    border-radius: 4px;
}

/* Grelha (Grid) */
.mn-term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Cartão do Termo */
.mn-term-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    border: 1px solid #f0f0f0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
}

.mn-term-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: #d63638;
}

.mn-term-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #d63638;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.mn-term-card:hover::before {
    transform: scaleY(1);
}

/* Texto do Termo */
.mn-term-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    transition: color 0.3s;
}

.mn-term-card:hover .mn-term-title {
    color: #d63638;
}

/* Seta */
.mn-term-arrow {
    opacity: 0.3;
    transition: all 0.3s;
    font-size: 1.2em;
    color: #ccc;
}

.mn-term-card:hover .mn-term-arrow {
    opacity: 1;
    color: #d63638;
    transform: translateX(5px);
}


/* --- PÁGINA DO TERMO ÚNICO --- */

.mn-glossary-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
    position: relative;
}

.mn-glossary-header h1 {
    font-size: 2.2em;
    color: #111111 !important;
    margin: 0;
    font-weight: 800;
}

.mn-glossary-letter {
    position: absolute;
    right: 0;
    top: -10px;
    font-size: 80px;
    font-weight: 900;
    color: #f5f5f5;
    z-index: 0;
    pointer-events: none;
}

.mn-glossary-content {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
}

.mn-glossary-content p {
    margin-bottom: 20px;
}

.mn-glossary-content h2, 
.mn-glossary-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #000;
    font-weight: 700;
}

/* --- ELEMENTOS DE UI --- */

.mn-glossary-cat-link {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f5f5f5;
    color: #000;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85em;
    transition: background 0.2s;
}

.mn-glossary-cat-link:hover {
    background-color: #e0e0e0;
}

.mn-glossary-meta {
    margin-top: 15px;
    font-size: 0.9em;
    color: #666;
    display: flex;
    align-items: center;
    gap: 15px;
}

#mn-feedback-box {
    margin-top: 50px;
    padding: 25px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

#mn-feedback-text {
    width: 100%;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    background: #fff;
    color: #333;
}


/* =========================================
   2. DARK MODE (COMPATIBILIDADE FOXIZ)
   ========================================= */

/* Deteta quando o tema ativa o modo escuro */
html[data-theme="dark"] .mn-glossary-container,
body.is-dark .mn-glossary-container,
.dark-mode .mn-glossary-container {
    background-color: transparent !important; /* Fica transparente para usar o fundo do tema */
    border: none !important;
    box-shadow: none !important;
    color: #ddd !important;
}

/* Cartões: Fundo Escuro */
html[data-theme="dark"] .mn-term-card,
body.is-dark .mn-term-card,
.dark-mode .mn-term-card {
    background-color: #1e1e1e !important; /* Cinza bem escuro */
    border-color: #333 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

html[data-theme="dark"] .mn-term-card:hover,
body.is-dark .mn-term-card:hover,
.dark-mode .mn-term-card:hover {
    background-color: #2a2a2a !important;
}

/* Texto: Branco */
html[data-theme="dark"] .mn-term-title,
body.is-dark .mn-term-title,
.dark-mode .mn-term-title {
    color: #ffffff !important;
}

/* Setas */
html[data-theme="dark"] .mn-term-arrow,
body.is-dark .mn-term-arrow,
.dark-mode .mn-term-arrow {
    color: #666 !important;
}

html[data-theme="dark"] .mn-term-card:hover .mn-term-arrow,
body.is-dark .mn-term-card:hover .mn-term-arrow,
.dark-mode .mn-term-card:hover .mn-term-arrow {
    color: #d63638 !important;
}

/* Títulos da Página Única */
html[data-theme="dark"] .mn-glossary-header h1,
body.is-dark .mn-glossary-header h1,
.dark-mode .mn-glossary-header h1,
html[data-theme="dark"] .mn-glossary-content h2, 
html[data-theme="dark"] .mn-glossary-content h3,
body.is-dark .mn-glossary-content h2,
body.is-dark .mn-glossary-content h3,
.dark-mode .mn-glossary-content h2 {
    color: #ffffff !important;
}

/* Texto do Conteúdo */
html[data-theme="dark"] .mn-glossary-content,
body.is-dark .mn-glossary-content,
.dark-mode .mn-glossary-content {
    color: #ccc !important;
}

/* Letras A, B, C... */
html[data-theme="dark"] .mn-glossary-letter-section h3,
body.is-dark .mn-glossary-letter-section h3,
.dark-mode .mn-glossary-letter-section h3 {
    color: #fff !important;
}

/* Feedback Box Dark */
html[data-theme="dark"] #mn-feedback-box,
body.is-dark #mn-feedback-box,
.dark-mode #mn-feedback-box {
    background-color: #222 !important;
    border-color: #444 !important;
}

html[data-theme="dark"] #mn-feedback-text,
body.is-dark #mn-feedback-text,
.dark-mode #mn-feedback-text {
    background-color: #333 !important;
    color: #fff !important;
    border-color: #555 !important;
}

/* Mobile Ajustes */
@media (max-width: 768px) {
    .mn-term-grid {
        grid-template-columns: 1fr;
    }
    .mn-glossary-container {
        padding: 15px;
    }
}