/* =========================================
   1. VARIABLES & THEMES
   ========================================= */
:root {
    /* --- TEMA CLARO (Default) --- */
    --brand-color: #3b82f6;       /* Azul MOOC List */
    --brand-hover: #2563eb;
    
    --bg-body: #f9fafb;           /* Cinza muito claro */
    --bg-surface: #f6f6ff;        /* Branco */
    --bg-header: #ffffff;
    
    --text-main: #111827;         /* Quase preto */
    --text-muted: #6b7280;        /* Cinza médio */
    
    --border-color: #e5e7eb;      /* Cinza borda */
    --radius: 8px;
    
    --container-width: 1200px;
    --header-height: 70px;
}

/* --- TEMA ESCURO (Ativado via JS data-theme="dark") --- */
[data-theme="dark"] {
    --brand-color: #60a5fa;       /* Azul mais claro para contraste */
    --brand-hover: #3b82f6;
    
    --bg-body: #111827;           /* Fundo muito escuro */
    --bg-surface: #1f2937;        /* Cinza escuro (Cartões) */
    --bg-header: #1f2937;
    
    --text-main: #f9fafb;         /* Quase branco */
    --text-muted: #9ca3af;        /* Cinza claro */
    
    --border-color: #374151;      /* Borda escura */
}

/* =========================================
   2. RESET & BASE
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    padding-top: var(--header-height);
    padding-bottom: 2rem;
    transition: background-color 0.3s, color 0.3s;
}

a { color: var(--brand-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--brand-hover); text-decoration: underline; }
img { max-width: 100%; display: block; }


/* =========================================
   UTILITY CLASSES (Margins)
   ========================================= */

/* --- MARGIN TOP (mt) --- */
.mt-1 { margin-top: 0.25rem !important; } /* ~4px */
.mt-2 { margin-top: 0.5rem !important; }  /* ~8px */
.mt-3 { margin-top: 1rem !important; }    /* ~16px */
.mt-4 { margin-top: 1.5rem !important; }  /* ~24px */
.mt-5 { margin-top: 2rem !important; }    /* ~32px */
.mt-6 { margin-top: 3rem !important; }    /* ~48px */

/* --- MARGIN BOTTOM (mb) --- */
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }
.mb-6 { margin-bottom: 3rem !important; }

/* --- MARGIN LEFT (ml) --- */
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 2rem !important; }
.ml-6 { margin-left: 3rem !important; }

/* --- MARGIN RIGHT (mr) --- */
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 2rem !important; }
.mr-6 { margin-right: 3rem !important; }

/* --- MARGIN VERTICAL (my) - Topo e Baixo --- */
.my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; }
.my-2 { margin-top: 0.5rem !important;  margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 1rem !important;    margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important;  margin-bottom: 1.5rem !important; }
.my-5 { margin-top: 2rem !important;    margin-bottom: 2rem !important; }
.my-6 { margin-top: 3rem !important;    margin-bottom: 3rem !important; }

/* --- MARGIN HORIZONTAL (mx) - Esquerda e Direita --- */
.mx-1 { margin-left: 0.25rem !important; margin-right: 0.25rem !important; }
.mx-2 { margin-left: 0.5rem !important;  margin-right: 0.5rem !important; }
.mx-3 { margin-left: 1rem !important;    margin-right: 1rem !important; }
.mx-4 { margin-left: 1.5rem !important;  margin-right: 1.5rem !important; }
.mx-5 { margin-left: 2rem !important;    margin-right: 2rem !important; }
.mx-6 { margin-left: 3rem !important;    margin-right: 3rem !important; }


.icon-1{
    display: inline-block;
    vertical-align:text-top;
    width: 4rem;
}

.icon-2{
    display: inline-block;
    vertical-align:text-top;
    width: 3.5rem;
}

.icon-3{
    display: inline-block;
    vertical-align:text-top;
    width: 3rem;
}

.icon-4{
    display: inline-block;
    vertical-align:text-top;
    width: 2.5rem;
}

.icon-5{
    display: inline-block;
    vertical-align:text-top;
    width: 2rem;
}

.icon-6{
    display: inline-block;
    vertical-align:text-top;
    width: 1.5rem;
}

.icon-7{
    display: inline-block;
    vertical-align:text-top;
    width: 1rem;
}

.icon-8{
    display: inline-block;
    vertical-align:sub;
    width: 0.8rem;
}

/* --- Tipografia & Cores --- */
.text-2xl { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-accent { color: var(--accent); }
.text-muted{ color: var(--text-muted); }

/* =========================================
   3. LAYOUT & GRID
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* =========================================
   4. NAVBAR & HEADER (Flexbox System)
   ========================================= */
.site-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-inner {
    display: flex; /* Mudança para Flexbox */
    align-items: center;
    gap: 1.5rem; /* Espaço mínimo entre elementos */
    width: 100%;
    height: 100%;
}

/* --- LOGO (Fixo à esquerda) --- */
.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0; /* Impede que o logo seja esmagado */
}
.logo span { color: var(--brand-color); }

/* --- SEARCH AREA (Fluido) --- */
.header-search {
    flex-grow: 1; /* Ocupa o espaço disponível */
    max-width: 400px; /* Mas não cresce mais que isto */
}

.search-form {
    background: var(--bg-input); 
    border: 1px solid transparent;
    border-radius: 50px;
    padding: 0.25rem 0.75rem;
    width: 100%;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.search-form:focus-within {
    background: var(--bg-surface);
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0 0.5rem 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 100%;
}
.search-btn svg { width: 18px; height: 18px; stroke: currentColor; }
.search-btn:hover { color: var(--brand-color); }

.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.9rem;
    width: 100%;
    font-family: inherit;
    /* Remove padding extra que desalinhava */
    padding: 0; 
    height: 30px; /* Altura fixa para alinhar texto */
}

/* --- THEME TOGGLE (Empurrado para a direita) --- */
.btn-theme {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    
    /* A MAGIA: Empurra o botão para o extremo direito */
    margin-left: auto; 
    flex-shrink: 0;
}
.btn-theme:hover { background-color: var(--bg-body); border-color: var(--text-muted); }
.btn-theme svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }

.footer{
    margin: 2rem auto; padding-top: 2rem; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.8rem;
}

.footer p{
    text-align: center;
}

/* --- RESPONSIVIDADE (Mobile & Tablet) --- */
@media (max-width: 768px) {
    .header-inner {
        gap: 1rem; /* Reduz espaço entre elementos */
    }

    .logo {
        font-size: 1.4rem; /* Logo um pouco menor */
    }

    .header-search {
        max-width: none; /* Deixa esticar se necessário */
    }
    
    .search-input {
        /* Opcional: em ecrãs muito pequenos, reduz o placeholder ou esconde */
        font-size: 0.85rem;
    }
}

/* Para ecrãs MUITO pequenos (iPhone SE, etc) */
@media (max-width: 480px) {
    /* Reduz o tamanho da fonte para o Logo inteiro caber */
    .logo { 
        font-size: 1.15rem; 
    }
    
    /* Reduz a barra de pesquisa para dar prioridade ao logo */
    .search-input { 
        width: 100px; 
        font-size: 0.8rem;
    }
    
    /* Diminui o gap entre os elementos do header */
    .header-inner {
        gap: 0.5rem;
    }

    /* Reduz ligeiramente o botão de tema */
    .btn-theme {
        width: 32px;
        height: 32px;
    }
    .btn-theme svg {
        width: 16px;
        height: 16px;
    }
}

/* =========================================
   5. CARD COURSE
   ========================================= */
.c-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.c-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* IMAGEM & PROVIDER */
.c-card__img-wrapper {
    position: relative;
    height: 160px;
    background-color: var(--border-color);
    overflow: hidden;
}

.c-card__img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
}
.c-card:hover .c-card__img { transform: scale(1.05); }

.c-badge-provider {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0, 0, 0, 0.75); color: #fff;
    padding: 4px 8px; border-radius: 4px;
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    z-index: 2;
}

/* CORPO */
.c-card__body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.c-card__uni {
    font-size: 0.8rem; color: var(--text-muted); font-weight: 500;
    margin-bottom: 0.25rem;
}

.c-card__title {
    font-size: 1.1rem; margin-bottom: 0.5rem; font-weight: 700; line-height: 1.35;
}
.c-card__title a { color: var(--text-main); text-decoration: none; }
.c-card__title a:hover { color: var(--brand-color); }

/* Categorias */
.c-card__cats {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; margin-bottom: 0.75rem;
}
.c-card__cats a { color: var(--brand-color); text-decoration: none; }
.c-card__cats a:hover { text-decoration: underline; }
.c-card__cats a:not(:last-child):after {
    content: ", "; color: var(--text-muted); text-decoration: none; display: inline-block;
}

/* Intro */
.c-card__intro {
    font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Meta */
.c-card__meta {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.8rem; color: var(--text-muted);
    padding-bottom: 0.75rem; margin-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border-color);
}

/* Tags */
.c-card__tags {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0.5rem;
}
.tag {
    font-size: 0.7rem; background: var(--bg-body); color: var(--text-muted);
    padding: 3px 8px; border: 1px solid var(--border-color); border-radius: 4px;
    text-decoration: none; transition: all 0.2s;
    display: inline-block; white-space: nowrap;
}
.tag:hover {
    background: var(--border-color); color: var(--text-main); border-color: var(--text-muted);
}

/* Footer & Btn */
.c-card__footer {
    padding: 0.75rem 1.25rem;
    background: var(--bg-body);
    border-top: 1px solid var(--border-color);
    text-align: right;
}
.c-btn-details {
    display: inline-block; background-color: transparent;
    color: var(--brand-color); border: 1px solid var(--brand-color);
    padding: 4px 14px; border-radius: 50px;
    font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; text-decoration: none;
    transition: all 0.2s ease;
}
.c-btn-details:hover {
    background-color: var(--brand-color); color: #fff;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.3); text-decoration: none;
}

/* --- SEARCH AREA (Centro) --- */
.header-search {
    display: flex;
    align-items: center;
    max-width: 400px;
    width: 100%;
}

/* O Form é que tem a "caixa" cinzenta arredondada */
.search-form {
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: 50px;
    padding: 0.2rem 1rem; /* Padding reduzido verticalmente pois o input tem altura */
    width: 100%;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

/* Efeito de Focus em todo o formulário */
.search-form:focus-within {
    background: var(--bg-surface);
    border-color: var(--brand-color); /* Borda azul ao escrever */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-form:hover {
    border-color: var(--border-color);
}

/* Botão Lupa */
.search-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.search-btn:hover {
    color: var(--brand-color);
}

/* Input Real */
.search-input {
    background: transparent;
    border: none;
    outline: none; /* Remove outline nativo feio */
    color: var(--text-main);
    font-size: 0.9rem;
    width: 100%;
    padding: 0.5rem;
    font-family: inherit;
}
.search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

/* =========================================
   6. COURSE DETAIL PAGE 
   ========================================= */

/* --- Header e Títulos --- */
.course-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.course-provider-label {
    font-size: 0.9rem;
    color: var(--brand-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.course-title-main {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.course-offered-by {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- Layout Principal (Grid) --- */
.course-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Conteúdo | Sidebar */
    gap: 3rem;
    align-items: start;
}

/* --- Imagem de Capa --- */
.course-hero-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    background-color: var(--bg-surface);
}

/* --- Tipografia da Descrição (Markdown) --- */
.course-description {
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--text-main);
}
.course-description p { margin-bottom: 1.5rem; }
.course-description ul, .course-description ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
.course-description li { margin-bottom: 0.5rem; }
.course-description h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; font-weight: 700; }
.course-description h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.75rem; font-weight: 600; }
.course-description strong { color: var(--text-main); font-weight: 700; }

/* --- Botão CTA (Go to Class) --- */
.course-cta-wrapper {
    margin-top: 3rem;
    text-align: center;
}

.btn-cta-primary {
    display: inline-block;
    background: var(--brand-color);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-cta-primary:hover {
    background-color: var(--brand-hover);
    transform: translateY(-2px);
    text-decoration: none;
    color: #fff;
}

/* --- Sidebar (Sticky) --- */
.course-sidebar {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 90px; /* Ajustado para não bater no header fixo */
}

.sidebar-title {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.meta-group {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.meta-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.meta-value-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.sidebar-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* --- Responsividade Mobile --- */
@media (max-width: 768px) {
    .course-layout {
        grid-template-columns: 1fr; /* Empilha tudo */
        gap: 2rem;
    }
    
    .course-title-main {
        font-size: 2rem;
    }

    .course-hero-img {
        height: 200px;
    }
    
    .course-sidebar {
        position: static; /* Remove sticky no mobile */
    }
}

/* =========================================
   8. FILTERS & AUTOCOMPLETE (Homepage)
   ========================================= */

.title-2{
    font-size: 1.5rem; 
    margin-bottom: 1.5rem; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 0.5rem;
}

/* Painel de Filtros (Details/Summary) */
.filter-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    margin-bottom: 2rem;
}

.btn-filter-toggle {
    padding: 1rem;
    cursor: pointer;
    font-weight: 700;
    outline: none;
    list-style: none; /* Remove triângulo default em alguns browsers */
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-filter-toggle::-webkit-details-marker { display: none; } /* Chrome fix */

.filter-form {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Inputs do Filtro */
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--brand-color);
    outline: none;
}

.filter-open{
    font-size: 0.8rem; 
    opacity: 0.6;
}
/* Ações do Filtro */
.filter-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-primary {
    background: var(--brand-color);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.btn-primary:hover { background: var(--brand-hover); }

.btn-secondary {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-secondary:hover { color: var(--text-main); }

/* Autocomplete Dropdown */
.relative { position: relative; }

.autocomplete-dropdown {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-top: none;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 0 0 4px 4px;
}

.autocomplete-item {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover {
    background: var(--bg-body);
    color: var(--brand-color);
}

/* Paginação */
.pagination-wrapper {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.btn-pagination {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-main);
    font-weight: 500;
}
.btn-pagination:hover {
    border-color: var(--brand-color);
    color: var(--brand-color);
    text-decoration: none;
}
.page-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.not-found{
    grid-column: 1/-1; 
    padding: 2rem; 
    text-align: center; 
    background: var(--bg-surface); 
    border: 1px dashed var(--border-color);
}
/* =========================================
   10. BACK TO TOP BUTTON
   ========================================= */
#btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--brand-color);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 9999;
    
    /* Estado inicial: Invisível e deslocado para baixo */
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: all 0.3s ease;
    
    display: flex;
    align-items: center;
    justify-content: center;
}

#btn-back-to-top:hover {
    background-color: var(--brand-hover);
    transform: translateY(-5px); /* Efeito de elevação ligeiro ao passar o rato */
}

/* Estado Visível (ativado por JS) */
#btn-back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* =========================================
   7. UTILITIES & HELPER CLASSES (New)
   ========================================= */

/* Texto pequeno (substitui style="font-size: 0.85rem") */
.text-sm {
    font-size: 0.85rem !important;
}

/* Ícone de Instrutor (substitui style="width: 20px") */
.icon-instructor {
    width: 20px;
    display: inline-block;
    text-align: center;
}

/* Garante que a imagem Hero ocupa a largura (substitui style="width:100%") */
/* Nota: .course-hero-img já tem width: 100% no CSS base, mas reforçamos se necessário */
.w-100 {
    width: 100% !important;
}

/* Ajuste para Tooltips em ícones isolados */
.icon-tooltip {
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   TOOLTIP VANILLA CUSTOM
   ========================================= */
.custom-tooltip {
    position: absolute;
    z-index: 10000;
    display: block;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-transform: none; /* Garante que não herda uppercase de lado nenhum */
    white-space: nowrap;
    
    /* Cores Invertidas para contraste (Fundo escuro, texto claro) */
    background-color: #333;
    color: #fff;
    
    border-radius: 4px;
    pointer-events: none; /* Permite clicar no elemento que está por baixo */
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Estado Visível */
.custom-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Pequena seta em baixo do tooltip (opcional, mas fica bonito) */
.custom-tooltip::after {
    content: "";
    position: absolute;
    top: 100%; /* No fundo do tooltip */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Ajuste para o teu Tema Escuro (se necessário) */
[data-theme="dark"] .custom-tooltip {
    background-color: var(--brand-color); /* Destaque no tema escuro */
    color: #fff;
}
[data-theme="dark"] .custom-tooltip::after {
    border-color: var(--brand-color) transparent transparent transparent;
}

/* =========================================
   BADGES & PILLS (Custom System)
   ========================================= */

/* Base Badge Style */
.c-badge {
    display: inline-flex;
    padding: 0.35em 0.8em;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    vertical-align: baseline;
    border-radius: 50rem; /* Pill shape */
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    margin-right: 4px;
    margin-bottom: 4px;
    white-space: normal; 
    max-width: 100%;
    text-align: center; /* Ou left, conforme gosto */
    height: auto; /* Permite crescer em altura */    
    /* Garante alinhamento vertical */
    align-items: center;
    justify-content: center;
}

.c-badge:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

/* --- VARIAÇÃO 1: TAGS (Neutro / Secundário) --- */
.c-badge--tag {
    background-color: var(--bg-body);
    color: var(--text-muted);
    border-color: var(--border-color);
}
.c-badge--tag:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
    background-color: var(--border-color);
}

/* --- VARIAÇÃO 2: CATEGORIAS (Primary / Brand) --- */
.c-badge--cat {
    background-color: rgba(59, 130, 246, 0.1); /* Azul muito suave transparente */
    color: var(--brand-color);
    border-color: var(--brand-color);
}
.c-badge--cat:hover {
    background-color: var(--brand-color);
    color: #ffffff;
}

/* --- VARIAÇÃO 3: LÍNGUAS (Info / Verde ou Turquesa) --- */
/* Adicionar var de cor local ou usar valor fixo que funcione em dark/light */
.c-badge--lang {
    background-color: transparent;
    color: #10b981; /* Verde Esmeralda */
    border-color: #10b981;
}
.c-badge--lang:hover {
    background-color: #10b981;
    color: #ffffff;
}

/* Instrutor (Roxo) */
.c-badge--inst {
    background-color: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    border-color: #7c3aed;
}
.c-badge--inst:hover {
    background-color: #7c3aed;
    color: #fff;
}

/* Certificado (Dourado/Amarelo) */
.c-badge--cert {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-color: #d97706;
}
.c-badge--cert:hover {
    background-color: #d97706;
    color: #fff;
}

/* Ajuste para Dark Mode específico se necessário */
[data-theme="dark"] .c-badge--cat {
    background-color: rgba(59, 130, 246, 0.15);
}
[data-theme="dark"] .c-badge--inst { background-color: rgba(139, 92, 246, 0.2); color: #a78bfa; border-color: #a78bfa; }
[data-theme="dark"] .c-badge--cert { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: #fbbf24; }

/* =========================================
   SEARCH RESULTS PAGE
   ========================================= */

/* Área do Formulário (mais largo que na navbar) */
.search-page-form {
    display: flex;
    max-width: 600px;
}
.search-page-input {
    font-size: 1.1rem;
    padding: 0.8rem;
    border-radius: 4px;
}

/* Item de Resultado Individual */
.search-item {
    margin-bottom: 2rem;
    max-width: 800px; /* Não deixar o texto esticar demasiado para facilitar a leitura */
}

/* Título do Resultado */
.search-item-title {
    margin-bottom: 0.2rem;
    font-size: 1.25rem;
    line-height: 1.3;
}
.search-item-title a {
    color: #1a0dab; /* Azul clássico de link de pesquisa, ou usa var(--brand-color) */
    text-decoration: none;
}
.search-item-title a:hover {
    text-decoration: underline;
}

/* Meta Dados (Provider • Universidade) - Estilo "URL Verde" */
.search-item-meta {
    font-size: 0.85rem;
    color: #006621; /* Verde clássico de motor de busca */
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Snippet de Texto */
.search-item-snippet {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
}

/* Highlight (o <mark> que vem do SQL) */
.search-item-snippet mark {
    background-color: transparent; /* Sem fundo amarelo */
    color: var(--text-main);
    font-weight: 700; /* Apenas negrito */
    padding: 0;
}

/* Dark Mode Overrides para a Pesquisa */
[data-theme="dark"] .search-item-title a {
    color: #8ab4f8; /* Azul claro para fundo escuro */
}
[data-theme="dark"] .search-item-meta {
    color: #81c995; /* Verde claro para fundo escuro */
}
[data-theme="dark"] .search-item-snippet {
    color: #bdc1c6; /* Cinza claro */
}
[data-theme="dark"] .search-item-snippet mark {
    color: #fff;
    font-weight: 700;
}

.classdeal{
    background:#f8f9fa; padding:15px; border-left:5px solid #fbbf24; margin: 20px 0; font-size:1.1rem;
}

[data-theme="dark"] .classdeal{
    background: transparent; color: var(--text-main);
}

body.error-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
}
.error-container {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--error);
    line-height: 1;
    margin-bottom: 10px;
    opacity: 0.8;
}
.error-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-main);
}
.error-desc {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-family: monospace;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: var(--radius);
    width: 100%;
}

/* Classe .wb (white bold) */
.wb { color: white; font-weight: bold; }
