/*
 * CSS Customizado para o Prêmio Visconde de Mauá
 * Versão 6.1 - Responsividade do cronograma e banner mobile corrigida
 */

/* 1. Paleta de Cores e Configurações Globais
-------------------------------------------------------------- */
:root {
    --primary-color: #1b3b4b;
    --secondary-color: #c4a35a;
    --tertiary-color: #356859;
    --light-gray: #f8f9fa;
    --extra-light-gray: #e9ecef;
    --dark-gray: #212529;
    --text-color: #495057;
    --body-font: "Open Sans", sans-serif;
    --heading-font: "Montserrat", sans-serif;
}

body {
    font-family: var(--body-font);
    color: var(--text-color);
    background-color: #fff;
    line-height: 1.7;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--heading-font);
    font-weight: 700;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    color: var(--primary-color);
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 5px;
    background: linear-gradient(
        90deg,
        var(--secondary-color),
        var(--tertiary-color)
    );
    border-radius: 5px;
}

.section-bg-gradient {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}

/* 2. Cabeçalho e Navegação
-------------------------------------------------------------- */
.navbar .nav-link {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active {
    color: var(--secondary-color) !important;
    background-color: var(--primary-color) !important;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #002244;
    border-color: #002244;
    transform: scale(1.05);
}

/* 3. Seção Banner
-------------------------------------------------------------- */
.banner-maua {
    padding: 0;
    margin: 0;
    background-size: cover !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
    min-height: 80vh;
}

.banner-img {
    display: block;
    width: 100%;
    height: auto;
}

.selo-premio {
    max-width: 180px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
}

.animated-button {
    background-color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    color: var(--primary-color);
    padding: 1rem 2.8rem;
    transition: all 0.3s ease-in-out;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.animated-button:hover {
    background-color: var(--tertiary-color);
    border-color: var(--tertiary-color);
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 128, 128, 0.5);
}

/* 4. Cartões (Patrono, Categorias, Reconhecimento)
-------------------------------------------------------------- */
.patrono-card {
    background-color: #fff;
    border: 1px solid var(--extra-light-gray);
    border-bottom: 5px solid var(--primary-color);
}

.patrono-card img {
    border: 5px solid var(--light-gray);
}

.category-card {
    border: 1px solid var(--extra-light-gray);
    border-bottom: 4px solid var(--tertiary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 51, 102, 0.1) !important;
    border-bottom-color: var(--secondary-color);
}

.icon-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(
        45deg,
        var(--primary-color),
        var(--tertiary-color)
    );
    color: white;
    box-shadow: 0 5px 15px rgba(0, 128, 128, 0.3);
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border-radius: 50%;
}

.category-card:hover .icon-circle {
    background: linear-gradient(45deg, var(--secondary-color), #ffc107);
    box-shadow: 0 5px 20px rgba(218, 165, 32, 0.5);
}

.category-card .card-title {
    color: var(--primary-color);
    font-weight: 700;
}

/* 5. Barra de Inscrição
-------------------------------------------------------------- */
.inscricao-bar {
    background-image: linear-gradient(
            rgba(0, 27, 54, 0.9),
            rgba(0, 128, 128, 0.8)
        ),
        url(https://www.transparenttextures.com/patterns/subtle-stripes.png);
    padding: 4rem 0;
}

/* 6. Cronograma (Timeline)
-------------------------------------------------------------- */
.main-timeline {
    position: relative;
}

.main-timeline::after {
    content: "";
    position: absolute;
    width: 3px;
    background-color: var(--extra-light-gray);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
    z-index: 1; /* Linha de base */
}

.timeline-item {
    padding: 1rem 3rem;
    position: relative;
    width: 50%;
    z-index: 2;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 50px;
    text-align: right;
}
.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 50px;
    text-align: left;
}

.timeline-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: var(--tertiary-color);
    border: 3px solid #fff;
    top: 32px;
    border-radius: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.timeline-item:hover .timeline-icon {
    background-color: var(--secondary-color);
}

.timeline-item-next .timeline-icon {
    background-color: var(--secondary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(218, 165, 32, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(218, 165, 32, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(218, 165, 32, 0);
    }
}

.timeline-item:nth-child(odd) .timeline-icon {
    right: -20px;
}
.timeline-item:nth-child(even) .timeline-icon {
    left: -20px;
}

.timeline-date {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-content {
    padding: 25px;
    background-color: #fff;
    border: 1px solid var(--extra-light-gray);
    position: relative;
    border-radius: 8px;
    border-bottom: 4px solid var(--primary-color);
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.timeline-item:hover .timeline-content {
    border-bottom-color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
}

.timeline-content .title {
    font-size: 1.3rem;
    color: var(--tertiary-color);
    margin-top: 0;
}

.timeline-item-next .timeline-content .title {
    color: var(--secondary-color);
}

.btn-success {
    background-color: var(--tertiary-color);
    border-color: var(--tertiary-color);
}

.btn-success:hover {
    background-color: #006868;
    border-color: #006868;
}

/* 7. Seção regimento
-------------------------------------------------------------- */
#regimento .list-group-item {
    background: transparent;
    border-color: var(--extra-light-gray);
}
.card-regimento {
    border: 2px dashed var(--tertiary-color);
    background-color: #fff;
}

/* 8. CTA Section e Lista de Documentos
-------------------------------------------------------------- */
.cta-section {
    background: var(--primary-color);
    padding: 5rem 0;
}

.cta-section .section-title {
    color: #fff;
}

.cta-section .section-title::after {
    background: #fff;
}

.btn-light {
    font-weight: 700;
}
.btn-light:hover {
    background-color: var(--extra-light-gray);
    transform: scale(1.05);
}

.document-list li {
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
    transition: background-color 0.3s ease;
}
.document-list i {
    color: var(--secondary-color);
}
.document-list li:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

/* 9. Estilos do Acordeão nos Cards de Categoria
-------------------------------------------------------------- */
.category-card .accordion-item {
    border: none;
}

.category-card .accordion-button {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    background-color: var(--light-gray);
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--extra-light-gray);
    text-align: center;
    display: block;
    box-shadow: none;
}

.category-card .accordion-button:not(.collapsed) {
    background-color: var(--tertiary-color);
    color: #fff;
}

.category-card .accordion-button::after {
    display: none; /* Remove a seta padrão do Bootstrap */
}

.category-card .accordion-button:hover {
    background-color: var(--extra-light-gray);
}
.category-card .accordion-button:not(.collapsed):hover {
    background-color: #006868;
}

.category-card .accordion-body {
    padding: 1rem;
    background-color: var(--light-gray);
}

.criteria-list {
    font-size: 0.85rem;
    padding-left: 0.5rem;
}

.criteria-list li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.2rem;
}

.criteria-list li::before {
    content: "\f058"; /* Ícone de check do Font Awesome */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--tertiary-color);
    position: absolute;
    left: 0;
    top: 2px;
}

.criteria-text {
    font-size: 0.9rem;
}

/* 10. REGRAS DE RESPONSIVIDADE
-------------------------------------------------------------- */

/* 10.1. Ajustes Gerais para Tablets e Dispositivos Menores */
@media (max-width: 991.98px) {
    .category-card,
    .patrono-card {
        margin-bottom: 2rem;
    }
    .category-card {
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    /* 10.2. Ajustes para Dispositivos Móveis (até 768px) */
    .banner-maua {
        background-image: url("../img/banner-principal.jpeg") !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        padding: 0 !important;
        min-height: 20vh !important;
        margin: 0 !important;
        /* Remove margens brancas acima e abaixo */
        border-top: none !important;
        border-bottom: none !important;
        background-color: transparent !important;
    }

    /* Esconde a tag <img> do banner desktop para que o background-image apareça */
    .banner-maua .banner-img {
        display: none;
    }

    /* --- CORREÇÃO DO CRONOGRAMA (TIMELINE) --- */
    .main-timeline::after {
        left: 25px; /* Posição da linha vertical da timeline */
    }

    .timeline-item {
        width: 100%;
        margin-bottom: 2rem;
        left: 0 !important; /* Reseta o posicionamento da versão desktop */
        padding-left: 70px; /* Espaço para o ícone (40px) e margens */
        padding-right: 15px;
        text-align: left !important;
    }

    /* Garante que ambos os lados se comportem da mesma forma no mobile */
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
        text-align: left;
        padding-left: 70px;
        padding-right: 15px;
    }

    .timeline-icon {
        /* Centraliza o ícone (40px de largura) na linha (em 25px) */
        left: 5px !important; /* Formula: 25px (posição da linha) - 20px (metade da largura do ícone) */
        right: auto !important;
    }

    /* Garante que a posição do ícone seja a mesma para todos os itens */
    .timeline-item:nth-child(odd) .timeline-icon,
    .timeline-item:nth-child(even) .timeline-icon {
        left: 5px !important;
        right: auto !important;
    }

    .timeline-content {
        padding: 15px;
        font-size: 0.95rem;
    }

    .timeline-content .title {
        font-size: 1.1rem;
    }

    .timeline-date {
        font-size: 0.95rem;
    }

    .category-card,
    .patrono-card {
        width: 100%;
        min-width: unset;
        margin-left: 0;
        margin-right: 0;
    }
    .icon-circle {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* 10.3. Ajustes para Telas Pequenas (até 576px) */
@media (max-width: 575.98px) {
    .section-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .banner-maua {
        min-height: 40vh;
        padding: 0;
    }

    .document-list li {
        font-size: 0.95rem;
        padding: 0.5rem;
    }

    .cta-section {
        padding: 2rem 0;
    }

    .category-card .accordion-button {
        font-size: 0.85rem;
        padding: 0.5rem 0.5rem;
    }
    .category-card .accordion-body {
        padding: 0.5rem;
    }
}

/* 10.4. Outros Ajustes
-------------------------------------------------------------- */

/* Garante que apenas o item expandido do acordeão afete o layout */
.category-card .accordion-collapse:not(.show) {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
}

/* Oculta elementos desnecessários do banner que podem interferir */
.banner-maua h1,
.banner-maua p,
.banner-maua .descricao-banner,
.banner-maua .animated-button {
    display: none !important;
}

.parceiros img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
