/* Exames Prime - Estilos CSS para Filtro */

/* Barra de Filtros */
.exames-filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: var(--espacamento-filtros, 30px);
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    justify-content: center;
    align-items: center;
}

.categoria-btn {
    padding: 15px 20px;
    border: 2px solid var(--filtro-cor, #007cba);
    background: transparent;
    color: var(--filtro-cor, #007cba);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    font-size: 0.9rem;
    min-width: 120px;
    text-align: center;
}

.categoria-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(0, 123, 186, 0.1);
    color: var(--filtro-cor, #007cba);
    transition: all 0.3s ease;
}

.categoria-text {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
}

.categoria-btn:hover {
    background: var(--filtro-hover-cor, #005a87);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.3);
}

.categoria-btn:hover .categoria-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.categoria-btn.active {
    background: var(--filtro-ativo-bg, #007cba);
    color: var(--filtro-ativo-cor, #ffffff);
}

.categoria-btn.active .categoria-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Ícones específicos */
.categoria-icon-test-tube::before { content: "🧪"; }
.categoria-icon-blood-drop::before { content: "🩸"; }
.categoria-icon-microscope::before { content: "🔬"; }
.categoria-icon-heartbeat::before { content: "💓"; }
.categoria-icon-shield::before { content: "🛡️"; }
.categoria-icon-heart::before { content: "❤️"; }
.categoria-icon-dna::before { content: "🧬"; }
.categoria-icon-stethoscope::before { content: "🩺"; }
.categoria-icon-pill::before { content: "💊"; }
.categoria-icon-syringe::before { content: "💉"; }

.categoria-btn.active::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
}

/* Responsividade do Filtro */
@media (max-width: 768px) {
    .exames-filterbar {
        padding: 15px;
        gap: 8px;
    }
    
    .categoria-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .exames-filterbar {
        padding: 10px;
        gap: 6px;
        flex-direction: row;
        justify-content: center;
    }
    
    .categoria-btn {
        text-align: center;
        margin-bottom: 5px;
        font-size: 0.8rem;
        padding: 8px 12px;
        min-width: 80px;
    }
    
    .categoria-icon {
        display: none; /* Esconder ícones no mobile */
    }
    
    .categoria-text {
        font-size: 0.75rem;
    }
}

/* Modo Escuro para Filtros */
@media (prefers-color-scheme: dark) {
    .exames-filterbar {
        background: #e8e8e8;
        border-color: #4a5568;
    }
    
    .categoria-btn {
        border-color: #4299e1;
        color: #4299e1;
    }
    
    .categoria-btn:hover,
    .categoria-btn.active {
        background: #4299e1;
        color: white;
    }
}

/* Melhorias de Acessibilidade */
.categoria-btn:focus {
    outline: 2px solid var(--filtro-cor, #007cba);
    outline-offset: 2px;
}

/* Estados de Loading do Filtro */
.exames-filterbar.loading {
    opacity: 0.6;
    pointer-events: none;
}

.exames-filterbar.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--filtro-cor, #007cba);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animações do Filtro */
.categoria-btn {
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Estados de Hover Avançados */
.categoria-btn:hover {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(-2px);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Estados de Transição */
.categoria-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.categoria-btn:active {
    transform: scale(0.95);
}

/* Modo Compacto */
.exames-filterbar.compact {
    padding: 10px;
    margin-bottom: 20px;
}

.exames-filterbar.compact .categoria-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Modo Horizontal (padrão) */
.exames-filterbar.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
}

/* Modo Vertical */
.exames-filterbar.vertical {
    flex-direction: column;
    align-items: stretch;
}

.exames-filterbar.vertical .categoria-btn {
    text-align: center;
    margin-bottom: 5px;
}

/* Estados de Erro */
.categoria-btn.error {
    border-color: #dc3545;
    color: #dc3545;
}

.categoria-btn.error:hover {
    background: #dc3545;
    color: white;
}

/* Estados de Sucesso */
.categoria-btn.success {
    border-color: #28a745;
    color: #28a745;
}

.categoria-btn.success:hover {
    background: #28a745;
    color: white;
}

/* Contador de Filtros Ativos */
.exames-filterbar::after {
    content: attr(data-active-count);
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.exames-filterbar.has-active::after {
    opacity: 1;
}

/* Print Styles para Filtro */
@media print {
    .exames-filterbar {
        display: none;
    }
}

/* Estilos específicos para categorias de exames */
.categoria-btn[data-filter="sangue"] {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.categoria-btn[data-filter="sangue"]:hover,
.categoria-btn[data-filter="sangue"].active {
    background: #ff6b6b;
    color: white;
}

.categoria-btn[data-filter="urina"] {
    border-color: #ffc107;
    color: #ffc107;
}

.categoria-btn[data-filter="urina"]:hover,
.categoria-btn[data-filter="urina"].active {
    background: #ffc107;
    color: white;
}

.categoria-btn[data-filter="fezes"] {
    border-color: #6c757d;
    color: #6c757d;
}

.categoria-btn[data-filter="fezes"]:hover,
.categoria-btn[data-filter="fezes"].active {
    background: #6c757d;
    color: white;
}

.categoria-btn[data-filter="hormonios"] {
    border-color: #6f42c1;
    color: #6f42c1;
}

.categoria-btn[data-filter="hormonios"]:hover,
.categoria-btn[data-filter="hormonios"].active {
    background: #6f42c1;
    color: white;
}

.categoria-btn[data-filter="sorologias"] {
    border-color: #007bff;
    color: #007bff;
}

.categoria-btn[data-filter="sorologias"]:hover,
.categoria-btn[data-filter="sorologias"].active {
    background: #007bff;
    color: white;
}

.categoria-btn[data-filter="cardiologicos"] {
    border-color: #dc3545;
    color: #dc3545;
}

.categoria-btn[data-filter="cardiologicos"]:hover,
.categoria-btn[data-filter="cardiologicos"].active {
    background: #dc3545;
    color: white;
}
