/* ====================================================
   VARIÁVEIS DE CORES (A mágica do Dark/Light Mode)
==================================================== */
:root {
    /* MODO CLARO (Light) */
    --bg-color: #f8f9fa;
    --text-color: #333333;
    --header-bg: #ffffff;
    --border-color: #e2e8f0;
    --primary-color: #0f2e4a;
    /* Azul Escuro do Layout */
    --hover-color: #163b5e;
    --accent-color: #ff6600;
    /* Laranja dos Botões */
    --accent-hover: #e65c00;
    --overlay-bg: rgba(0, 0, 0, 0.4);
    --sidebar-bg: #ffffff;
}

[data-theme="dark"] {
    /* MODO ESCURO (Dark) */
    --bg-color: #0d1a26;
    --text-color: #f1f5f9;
    --header-bg: #0f2e4a;
    --border-color: #1e3a5f;
    --primary-color: #60a5fa;
    --hover-color: #93c5fd;
    --accent-color: #ff6600;
    --accent-hover: #ff8533;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --sidebar-bg: #0f2e4a;
}

/* ====================================================
   RESET E CONFIGURAÇÕES GERAIS
==================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    /* Transição suave de cores quando altera os modos */
    transition: background-color 0.4s ease, color 0.4s ease;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ====================================================
   CABEÇALHO (HEADER) - DESKTOP
==================================================== */
.main-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1200px;
    z-index: 1000;
    background-color: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 26px;
    color: var(--primary-color);
    font-weight: 700;
}

.desktop-nav {
    margin-left: auto;
    /* Empurra o menu para a direita */
    margin-right: 20px;
}

.desktop-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
    /* Espaço entre os itens do menu */
}

.desktop-nav a {
    font-weight: 500;
    transition: color 0.3s;
}

.desktop-nav a:hover {
    color: var(--primary-color);
}

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

/* Botões do header sem estilo nativo */
.theme-btn,
.mobile-btn,
.close-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 22px;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
}

.theme-btn:hover,
.mobile-btn:hover,
.close-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
    /* Dá uma leve aumentada ao passar o mouse */
}

.mobile-btn {
    display: none;
    /* Escondido no Desktop */
}

/* ====================================================
   CONTEÚDO PRINCIPAL E RODAPÉ
==================================================== */
.main-content {
    min-height: calc(100vh - 160px);
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.main-footer {
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 25px;
    transition: background-color 0.4s ease;
}

/* ====================================================
   MENU LATERAL MOBILE (O DE 80%)
==================================================== */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -80%;
    /* Escondido totalmente à direita */
    width: 80%;
    /* Ocupa exatamente 80% pedido */
    height: 100%;
    background-color: var(--sidebar-bg);
    z-index: 1000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    /* Transição de deslizamento */
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1), background-color 0.4s ease;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    right: 0;
    /* Ao ativar, vai pra posição 0 e aparece na tela */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav ul {
    list-style: none;
    padding: 20px 25px;
}

.mobile-nav li {
    margin-bottom: 20px;
}

.mobile-nav a {
    display: block;
    font-size: 18px;
    font-weight: 500;
    transition: color 0.3s, padding-left 0.3s;
}

.mobile-nav a:hover {
    color: var(--primary-color);
    padding-left: 10px;
    /* Efeito de andar pro lado ao passar o dedo/mouse */
}

/* ====================================================
   REGRAS DE TELA MENOR (RESPONSIVIDADE)
==================================================== */
@media (max-width: 850px) {
    .desktop-nav {
        display: none;
        /* Esconde a lista de links no cabeçalho */
    }

    .mobile-btn {
        display: block;
        /* Mostra o menu hambúrguer */
    }
}

/* ====================================================
   CLASSES AUXILIARES PARA A HOMEPAGE
==================================================== */
/* ====================================================
   NOVO HERO BANNER - MODERNO E PREMIUM
   ==================================================== */
.hero-banner {
    min-height: 780px;
    background-image: linear-gradient(135deg, rgba(15, 46, 74, 0.98) 0%, rgba(15, 46, 74, 0.88) 50%, rgba(15, 46, 74, 0.75) 100%), url('/public/images/bannerhero2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    /* Edge to Edge Trick: estica a tela inteira ignorando o container */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: -40px;
    padding: 165px 20px 95px 20px;
    color: #ffffff;
    overflow: hidden;
}

/* Container do Hero para alinhar com o max-width de 1200px */
.hero-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    z-index: 2;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    max-width: 600px;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    max-height: 750px;
    object-fit: contain;
    object-position: bottom;
    margin-bottom: -450px;
    /* Ajustado para a nova altura da hero */
    transform: scale(1.5);
    /* Zoom mantido/aumentado */
    transform-origin: bottom center;
}

.hero-content {
    max-width: 750px;
    animation: fadeInUp 0.8s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 102, 0, 0.12);
    border: 1px solid rgba(255, 102, 0, 0.35);
    color: #ffa366;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
}

.hero-badge i {
    color: var(--accent-color);
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-title .highlight {
    color: var(--accent-color);
    background: linear-gradient(120deg, #ff7700 0%, #ffaa00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 35px;
    max-width: 650px;
}

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

.btn-lg {
    padding: 15px 35px;
    font-size: 1.05rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline-white {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: none;
}

.btn-outline-white:hover {
    background-color: #ffffff;
    color: #0f2e4a;
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
}

.btn-orange:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 102, 0, 0.3);
}



/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 10px;
}

.btn {
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    border: none;
    text-align: center;
}

.btn-orange {
    background-color: var(--accent-color);
    color: white;
}

.btn-orange:hover {
    background-color: var(--accent-hover);
}

.btn-outline-orange {
    background-color: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.btn-outline-orange:hover {
    background-color: var(--accent-color);
    color: white;
}

/* ====================================================
   RESPONSIVIDADE DO NOVO HERO
   ==================================================== */
@media (max-width: 992px) {
    .hero-banner {
        min-height: 680px;
        padding: 150px 20px 70px 20px;
    }

    .hero-title {
        font-size: 2.6rem;
    }

}

@media (max-width: 768px) {
    .hero-banner {
        min-height: 520px;
        background-image: linear-gradient(135deg, rgba(15, 46, 74, 0.98) 0%, rgba(15, 46, 74, 0.9) 60%, rgba(15, 46, 74, 0.8) 100%), url('/public/images/bannerhero2.png');
        padding: 140px 15px 60px 15px;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 35px;
    }

    .hero-content {
        align-items: center;
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-image {
        display: none;
        /* Oculta em telas muito pequenas para focar no conteúdo */
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.05rem;
        margin-bottom: 25px;
    }
}

@media (max-width: 576px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .hero-actions .btn-lg {
        width: 100%;
        justify-content: center;
    }
}

/* ====================================================
   PÁGINA DE CURSOS (NOVO LAYOUT)
   ==================================================== */
.courses-banner {
    min-height: 260px;
    background-image: linear-gradient(135deg, rgba(15, 46, 74, 0.98) 0%, rgba(15, 46, 74, 0.88) 50%, rgba(15, 46, 74, 0.75) 100%), url('/public/images/bannerhero2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: -40px;
    padding: 130px 20px 40px 20px;
    color: #ffffff;
}

.courses-banner-container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.courses-banner-container h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.courses-banner-container p {
    font-size: 1.05rem;
    color: #cbd5e1;
    line-height: 1.5;
}

/* Seção de Pesquisa */
.search-section {
    margin: 40px auto 25px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.search-container {
    position: relative;
    max-width: 650px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
}

.search-container input {
    width: 100%;
    padding: 15px 20px 15px 52px;
    border-radius: 50px;
    border: 1.5px solid var(--border-color);
    background-color: var(--header-bg);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.search-container input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 4px 20px rgba(255, 102, 0, 0.15);
}

/* Grid layout da página */
.courses-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 35px;
    max-width: 1200px;
    margin: 0 auto 80px auto;
    padding: 0 20px;
    align-items: start;
}

/* Sidebar de Filtros */
.filters-sidebar {
    background-color: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 100px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 1.5px solid var(--border-color);
}

.filters-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.btn-clear-link {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    padding: 2px 5px;
}

.btn-clear-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.filter-group {
    margin-bottom: 28px;
}

.filter-group h3 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-color);
    margin-bottom: 14px;
    opacity: 0.95;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    user-select: none;
    transition: color 0.2s ease;
}

.custom-checkbox:hover {
    color: var(--accent-color);
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--bg-color);
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.25s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--accent-color);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* Price range slider styles */
.price-slider-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-slider-container input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    outline: none;
}

.price-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: transform 0.1s ease, background-color 0.2s;
}

.price-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background-color: var(--accent-hover);
}

.price-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.highlight-val {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.88rem;
}

/* Grid de Cards */
.courses-content {
    min-height: 400px;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 25px;
}

/* Estilo do Card de Curso */
.course-card {
    background-color: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.01);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 102, 0, 0.25);
}

/* Placeholder da imagem */
.course-img-placeholder {
    height: 165px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #ffffff;
    font-size: 2.8rem;
    overflow: hidden;
}

.course-img-placeholder .img-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-top: 8px;
    opacity: 0.65;
}

/* Gradients discretas e harmônicas para cada categoria de curso */
.offshore-grad {
    background: linear-gradient(135deg, #0f2e4a 0%, #1e40af 100%);
}

.nrs-grad {
    background: linear-gradient(135deg, #0f2e4a 0%, #0d9488 100%);
}

.operacoes-grad {
    background: linear-gradient(135deg, #0f2e4a 0%, #6d28d9 100%);
}

.tecnico-grad {
    background: linear-gradient(135deg, #0f2e4a 0%, #be185d 100%);
}

.combos-grad {
    background: linear-gradient(135deg, #e65c00 0%, #f97316 100%);
}

.saude-grad {
    background: linear-gradient(135deg, #0f2e4a 0%, #059669 100%);
}

/* Corpo do Card */
.course-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.course-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.badge-presencial {
    background-color: rgba(255, 102, 0, 0.08);
    color: var(--accent-color);
    border: 1px solid rgba(255, 102, 0, 0.2);
}

.badge-ead {
    background-color: rgba(5, 150, 105, 0.08);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-semipresencial {
    background-color: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.course-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.35;
    /* Evita que títulos muito longos quebrem o alinhamento */
    min-height: 46px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-description {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Área de Preço */
.course-pricing {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.price-old {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
}

.price-current {
    color: var(--accent-color);
    font-size: 1.35rem;
    font-weight: 800;
}

/* Botão do Whatsapp estilizado */
.btn-whatsapp {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.95rem;
}

.btn-icon-whatsapp {
    height: 18px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: transform 0.2s;
}

.btn-whatsapp:hover .btn-icon-whatsapp {
    transform: scale(1.1) rotate(5deg);
}

/* Mensagem de Sem Resultados */
.no-results-msg {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--header-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    max-width: 450px;
    margin: 40px auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.01);
}

.no-results-msg i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.no-results-msg h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.no-results-msg p {
    font-size: 0.9rem;
    color: #64748b;
}

/* Classe utilitária para esconder os cards no filtro */
.hidden-course {
    display: none !important;
}

/* Responsividade do Layout */
@media (max-width: 992px) {
    .courses-layout {
        grid-template-columns: 240px 1fr;
        gap: 25px;
    }
    .courses-banner-container h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .courses-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .filters-sidebar {
        position: static;
        padding: 20px;
    }
    
    .courses-banner {
        min-height: 220px;
        padding: 120px 15px 30px 15px;
    }
    
    .courses-banner-container h1 {
        font-size: 1.8rem;
    }
    
    .courses-banner-container p {
        font-size: 0.95rem;
    }
    
    .search-section {
        margin: 30px auto 15px auto;
    }
}