/**
 * APCD Benefícios - Frontend Styles
 */

/* ========================================
   WRAPPER GERAL
   ======================================== */

.apcd-beneficios-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.apcd-beneficios-secao {
    margin-bottom: 40px;
}

.apcd-beneficios-secao:last-child {
    margin-bottom: 0;
}

.apcd-secao-titulo {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #1d2327;
}

/* ========================================
   ACCORDION (BENEFÍCIOS LOCAIS)
   ======================================== */

.apcd-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.apcd-accordion-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.apcd-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
}

.apcd-accordion-header:hover {
    background: #e9ecef;
}

.apcd-accordion-header:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

.apcd-accordion-titulo {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    flex: 1;
    padding-right: 15px;
}

.apcd-accordion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #2271b1;
    flex-shrink: 0;
}

.apcd-accordion-icon svg {
    transition: transform 0.2s ease;
}

.apcd-icon-minus {
    display: none;
}

.apcd-accordion-item.active .apcd-icon-plus {
    display: none;
}

.apcd-accordion-item.active .apcd-icon-minus {
    display: block;
}

.apcd-accordion-conteudo {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.apcd-accordion-item.active .apcd-accordion-conteudo {
    max-height: 2000px;
}

.apcd-accordion-conteudo-inner {
    padding: 20px;
    border-top: 1px solid #dee2e6;
    color: #495057;
    line-height: 1.7;
}

.apcd-accordion-conteudo-inner p {
    margin: 0 0 15px 0;
}

.apcd-accordion-conteudo-inner p:last-child {
    margin-bottom: 0;
}

.apcd-accordion-conteudo-inner ul,
.apcd-accordion-conteudo-inner ol {
    margin: 0 0 15px 20px;
    padding: 0;
}

.apcd-accordion-conteudo-inner li {
    margin-bottom: 8px;
}

.apcd-accordion-conteudo-inner a {
    color: #2271b1;
    text-decoration: none;
}

.apcd-accordion-conteudo-inner a:hover {
    text-decoration: underline;
}

/* ========================================
   CARDS LOCAIS (COM VER MAIS)
   ======================================== */

.apcd-beneficios-grid-local {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.apcd-card-local {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    transition: box-shadow 0.2s ease;
}

.apcd-card-local:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.apcd-card-badge-local {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1864ab;
    background: #e7f5ff;
    border: 1px solid #74c0fc;
    border-radius: 20px;
    margin-bottom: 12px;
}

.apcd-card-local .apcd-card-titulo {
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.apcd-card-local .apcd-card-descricao {
    font-size: 14px;
    color: #495057;
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
}

.apcd-card-local .apcd-card-preview {
    display: block;
}

.apcd-card-local .apcd-card-completo {
    display: none;
}

.apcd-card-local[data-expanded="true"] .apcd-card-preview {
    display: none;
}

.apcd-card-local[data-expanded="true"] .apcd-card-completo {
    display: block;
    animation: apcd-fade-in 0.3s ease;
}

.apcd-card-local .apcd-card-completo p {
    margin: 0 0 12px 0;
}

.apcd-card-local .apcd-card-completo p:last-child {
    margin-bottom: 0;
}

.apcd-card-local .apcd-card-completo ul,
.apcd-card-local .apcd-card-completo ol {
    margin: 0 0 12px 20px;
    padding: 0;
}

.apcd-card-local .apcd-card-completo li {
    margin-bottom: 6px;
}

.apcd-card-local .apcd-card-completo a {
    color: #2271b1;
    text-decoration: none;
}

.apcd-card-local .apcd-card-completo a:hover {
    text-decoration: underline;
}

.apcd-btn-ver-mais {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #2271b1;
    background-color: transparent;
    border: 2px solid #2271b1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
    text-decoration: none;
    line-height: 1.4;
}

.apcd-btn-ver-mais:hover {
    background-color: #2271b1;
    color: #fff;
}

.apcd-btn-ver-mais:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.apcd-btn-ver-mais:active {
    transform: scale(0.98);
}

.apcd-btn-ver-mais .apcd-btn-icon {
    transition: transform 0.2s ease;
}

.apcd-card-local[data-expanded="true"] .apcd-btn-ver-mais .apcd-btn-icon {
    transform: rotate(180deg);
}

/* ========================================
   CARDS GRID (BENEFÍCIOS GLOBAIS)
   ======================================== */

.apcd-beneficios-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.apcd-card-global {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.apcd-card-global:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.apcd-card-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2b8a3e;
    background: #ebfbee;
    border: 1px solid #69db7c;
    border-radius: 20px;
    margin-bottom: 12px;
}

.apcd-card-titulo {
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.apcd-card-descricao {
    font-size: 14px;
    color: #646970;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.apcd-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border: 2px solid #2271b1;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.apcd-card-btn:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.apcd-card-btn svg {
    transition: transform 0.2s ease;
}

.apcd-card-btn:hover svg {
    transform: translateX(3px);
}

/* ========================================
   LISTA (ALTERNATIVA)
   ======================================== */

.apcd-beneficios-lista {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.apcd-lista-item {
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.apcd-lista-titulo {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 12px 0;
}

.apcd-lista-descricao {
    font-size: 14px;
    color: #495057;
    line-height: 1.7;
    margin-bottom: 15px;
}

.apcd-lista-descricao p:last-child {
    margin-bottom: 0;
}

.apcd-lista-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #2271b1;
    background: transparent;
    border: 2px solid #2271b1;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.apcd-lista-btn:hover {
    background: #2271b1;
    color: #fff;
}

/* ========================================
   RESPONSIVO
   ======================================== */

@media screen and (max-width: 1024px) {
    .apcd-beneficios-grid,
    .apcd-beneficios-grid-local {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .apcd-beneficios-grid,
    .apcd-beneficios-grid-local {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .apcd-secao-titulo {
        font-size: 20px;
    }

    .apcd-accordion-header {
        padding: 14px 16px;
    }

    .apcd-accordion-titulo {
        font-size: 15px;
    }

    .apcd-accordion-conteudo-inner {
        padding: 16px;
    }

    .apcd-card-global,
    .apcd-card-local {
        padding: 20px;
    }

    .apcd-card-titulo {
        font-size: 16px;
    }

    .apcd-card-btn {
        width: 100%;
    }

    .apcd-btn-ver-mais {
        width: 100%;
    }
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes apcd-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.apcd-accordion-item,
.apcd-card-global,
.apcd-card-local,
.apcd-lista-item {
    animation: apcd-fade-in 0.3s ease;
}

/* Delay para itens em sequência */
.apcd-accordion-item:nth-child(1),
.apcd-card-global:nth-child(1),
.apcd-card-local:nth-child(1) { animation-delay: 0s; }
.apcd-accordion-item:nth-child(2),
.apcd-card-global:nth-child(2),
.apcd-card-local:nth-child(2) { animation-delay: 0.05s; }
.apcd-accordion-item:nth-child(3),
.apcd-card-global:nth-child(3),
.apcd-card-local:nth-child(3) { animation-delay: 0.1s; }
.apcd-accordion-item:nth-child(4),
.apcd-card-global:nth-child(4),
.apcd-card-local:nth-child(4) { animation-delay: 0.15s; }
.apcd-accordion-item:nth-child(5),
.apcd-card-global:nth-child(5),
.apcd-card-local:nth-child(5) { animation-delay: 0.2s; }
.apcd-card-local:nth-child(6) { animation-delay: 0.25s; }

/* ========================================
   FOCUS STATES (ACESSIBILIDADE)
   ======================================== */

.apcd-card-btn:focus,
.apcd-lista-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .apcd-accordion-conteudo {
        max-height: none !important;
    }

    .apcd-card-btn,
    .apcd-lista-btn {
        display: none;
    }

    .apcd-card-global,
    .apcd-accordion-item {
        break-inside: avoid;
    }
}
