/* Estilos Mobile-First para Consulta Pública - Natal Brilhante */

:root {
    --azul-primario: #0d6efd;
    --azul-secundario: #0a58ca;
    --azul-claro: #cfe2ff;
    --azul-hover: #0b5ed7;
    --verde-disponivel: #198754;
    --verde-claro: #d1e7dd;
    --amarelo-quase: #ffc107;
    --amarelo-claro: #fff3cd;
    --vermelho-esgotado: #dc3545;
    --vermelho-claro: #f8d7da;
    --cinza-texto: #6c757d;
    --cinza-bg: #f8f9fa;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/bg-xmas.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.7;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(240, 248, 255, 0.75) 100%);
    z-index: -1;
}

/* Container principal */
.container-fluid {
    position: relative;
    z-index: 1;
}

/* Imagem do topo */
.header-image-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.header-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    object-fit: contain;
}

/* Cabeçalho */
.titulo-principal {
    font-size: 1.75rem;
    font-weight: 700;
    color: #155724;
    margin-bottom: 0.5rem;
}

/* Box informativo */
.info-box {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--azul-primario);
}

.info-box h3 {
    color: #333;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.info-box p {
    margin: 0;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
}

.info-box ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.8;
}

.info-box li {
    margin-bottom: 0.5rem;
}

.info-box strong {
    color: #333;
    font-weight: 600;
}

/* Contadores */
.contador-box {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top-width: 3px;
}

.contador-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.contador-disponivel {
    border-top-color: #28a745;
}

.contador-reservado {
    border-top-color: #17a2b8;
}

.contador-icon {
    font-size: 2rem;
    color: #28a745;
}

.contador-disponivel .contador-icon {
    color: #28a745;
}

.contador-reservado .contador-icon {
    color: #17a2b8;
}

.contador-content {
    flex: 1;
}

.contador-label {
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.contador-disponivel .contador-label {
    color: #155724;
}

.contador-reservado .contador-label {
    color: #0c5460;
}

.contador-valor {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.contador-disponivel .contador-valor {
    color: #155724;
}

.contador-reservado .contador-valor {
    color: #0c5460;
}

/* Botão de agendar */
.btn-agendar {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-agendar:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.6);
    color: white;
    text-decoration: none;
}

.btn-agendar:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.4);
}

.btn-agendar i {
    font-size: 1.1rem;
}

/* Botão de atualizar */
.btn-atualizar {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    color: #856404;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.btn-atualizar:hover {
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 50%, #ffed4e 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6);
    color: #856404;
}

.btn-atualizar:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

.btn-atualizar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-atualizar i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.btn-atualizar:hover:not(:disabled) i {
    transform: rotate(180deg);
}

/* Container da tabela */
.tabela-container {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

/* Accordion */
.accordion {
    --bs-accordion-border-color: transparent;
}

.accordion-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.accordion-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-button {
    background: white;
    border: none;
    padding: 1.25rem 1rem;
    font-weight: 600;
    color: #333;
    box-shadow: none;
    min-height: 80px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.accordion-button:not(.collapsed) {
    background: var(--azul-claro);
    color: var(--azul-primario);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230d6efd'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    width: 1.25rem;
    height: 1.25rem;
}

.accordion-button.collapsed::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230d6efd'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(-90deg);
}

/* Conteúdo do cabeçalho do accordion */
.dia-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.dia-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.accordion-button:not(.collapsed) .dia-titulo {
    color: var(--azul-primario);
}

.dia-subtitulo {
    font-size: 0.85rem;
    color: var(--cinza-texto);
    margin: 0;
}

.dia-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.dia-vagas {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

/* Badges de status */
.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.status-badge:hover {
    transform: scale(1.05);
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.status-badge:hover::before {
    left: 100%;
}

.badge-disponivel {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: white;
}

.badge-quase {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #333;
}

.badge-esgotado {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%);
    color: white;
}

.status-badge {
    position: relative;
}

.status-badge > * {
    position: relative;
    z-index: 2;
}

/* Corpo do accordion */
.accordion-body {
    padding: 1.25rem;
    background: var(--cinza-bg);
}

.horarios-grid {
    display: grid;
    gap: 0.75rem;
}

.horario-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.horario-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.horario-hora {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.horario-vagas {
    font-size: 0.9rem;
    color: var(--cinza-texto);
    font-weight: 500;
}

.horario-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.horario-badge.badge-disponivel {
    background: var(--verde-claro);
    color: var(--verde-disponivel);
}

.horario-badge.badge-quase {
    background: var(--amarelo-claro);
    color: #856404;
}

.horario-badge.badge-esgotado {
    background: var(--vermelho-claro);
    color: var(--vermelho-esgotado);
}

/* Botão Ver Mais */
.btn-ver-mais {
    background: white;
    color: #28a745;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-ver-mais:hover {
    background: #28a745;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    border-color: #28a745;
}

/* Loading */
#loading {
    min-height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Mensagem de erro */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem;
}

.alert-danger {
    background: var(--vermelho-claro);
    color: var(--vermelho-esgotado);
}

.alert i {
    margin-right: 0.5rem;
}

/* Responsividade - Tablet */
@media (min-width: 768px) {
    .titulo-principal {
        font-size: 2.25rem;
    }

    .subtitulo {
        font-size: 1.5rem;
    }

    .info-box {
        padding: 1.5rem;
    }

    .info-box p {
        font-size: 1rem;
    }

    .contador-box {
        padding: 1.5rem;
    }

    .contador-label {
        font-size: 0.9rem;
    }

    .contador-valor {
        font-size: 2rem;
    }

    .dia-titulo {
        font-size: 1.5rem;
    }

    .horarios-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsividade - Desktop */
@media (min-width: 992px) {
    .container-fluid {
        max-width: 1200px;
        margin: 0 auto;
    }

    .horarios-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .horario-item {
        grid-template-columns: 1fr auto auto;
    }
}

/* Melhorias de acessibilidade */
.accordion-button:focus-visible {
    outline: 2px solid var(--azul-primario);
    outline-offset: 2px;
}

.btn-atualizar:focus-visible,
.btn-ver-mais:focus-visible {
    outline: 2px solid var(--azul-primario);
    outline-offset: 2px;
}

/* Animações suaves */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.accordion-item {
    animation: fadeIn 0.3s ease-out;
}

/* Área de toque maior para mobile */
@media (max-width: 767px) {
    .accordion-button {
        min-height: 90px;
        padding: 1rem;
    }

    .dia-header {
        width: 100%;
    }

    .dia-info {
        width: 100%;
        justify-content: space-between;
    }

    .horario-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        text-align: center;
    }

    .horario-hora {
        font-size: 1.1rem;
    }
}

