/**
 * Estilos para a página de listagem (Melhorado)
 */

/* Estilos para a tabela responsiva */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Estilos para o cabeçalho da tabela */
.table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.table thead th {
    position: relative;
    background-color: #212529;
    white-space: nowrap;
    vertical-align: middle;
}

.table thead th a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 1rem;
}

/* Estilo para linhas destacadas */
.highlight-row {
    animation: highlight-pulse 2s infinite;
    background-color: rgba(79, 129, 255, 0.1) !important;
}

/* Estilos para os previews de foto e assinatura */
.foto-preview {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid #f0f0f0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.foto-preview:hover {
    transform: scale(1.2);
    z-index: 5;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    border-color: #4e73df;
}

.assinatura-preview {
    width: 120px;
    height: 40px;
    object-fit: contain;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #f9f9f9;
    padding: 2px;
    border: 1px solid #e3e3e3;
}

.assinatura-preview:hover {
    transform: scale(1.2);
    z-index: 5;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    background-color: #ffffff;
}

/* Estilos para o placeholder de foto usando iniciais */
.foto-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    margin: 0 auto;
}

.foto-placeholder::before {
    content: attr(data-initials);
}

/* Estilos para ícones de ordenação */
.sort-icon {
    font-size: 0.8rem;
    margin-left: 5px;
}

/* Efeito para as linhas da tabela ao passar o mouse */
.table-hover-highlight {
    background-color: rgba(78, 115, 223, 0.05) !important;
    box-shadow: 0 0 10px rgba(78, 115, 223, 0.1);
    transition: all 0.3s ease;
}

/* Estilos para paginação */
.page-item.active .page-link {
    background-color: #4e73df;
    border-color: #4e73df;
}

.pagination .page-link {
    color: #4e73df;
    padding: 0.5rem 0.75rem;
    margin: 0 2px;
    border-radius: 3px;
}

.pagination .page-link:hover {
    background-color: #eaecf4;
}

.pagination .page-item.disabled .page-link {
    color: #858796;
}

/* Estilos para filtros */
.btn-filter {
    margin-right: 5px;
}

.filtro-avancado {
    display: none;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid #e3e6f0;
}

/* Animações para o filtro avançado */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in-out forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

/* Animação para destacar uma linha */
@keyframes highlight-pulse {
    0% { background-color: rgba(79, 129, 255, 0.1); }
    50% { background-color: rgba(79, 129, 255, 0.2); }
    100% { background-color: rgba(79, 129, 255, 0.1); }
}

/* Estilos para o modal de imagem */
#imagemAmpliada {
    max-height: 70vh;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.image-zoom-in {
    animation: zoom-in 0.5s ease-out;
}

@keyframes zoom-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Estilos para visualização em cards */
.pessoa-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.125);
    overflow: hidden;
}

.card-hover-highlight {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.highlight-card {
    animation: card-highlight-pulse 2s infinite;
    box-shadow: 0 0 15px rgba(79, 129, 255, 0.5);
}

@keyframes card-highlight-pulse {
    0% { box-shadow: 0 0 15px rgba(79, 129, 255, 0.5); }
    50% { box-shadow: 0 0 20px rgba(79, 129, 255, 0.8); }
    100% { box-shadow: 0 0 15px rgba(79, 129, 255, 0.5); }
}

.pessoa-foto {
    height: 180px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.pessoa-card:hover .pessoa-foto {
    transform: scale(1.05);
}

.pessoa-foto-placeholder {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e6e9f0 0%, #d5d8e0 100%);
    color: #6c757d;
    font-size: 3rem;
    font-weight: bold;
}

.pessoa-foto-placeholder::before {
    content: attr(data-initials);
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
}

.card-text {
    font-size: 0.9rem;
    color: #6c757d;
}

.card-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
    background-color: rgba(0, 0, 0, 0.02);
    padding: 0.75rem 1.25rem;
}

/* Estilos para os badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-light {
    border: 1px solid #dee2e6;
}

/* Estilos para o toast de notificação */
.toast {
    min-width: 300px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: none;
    opacity: 1;
}

.toast-header {
    border-bottom: none;
    padding: 0.75rem 1rem;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.toast-body {
    padding: 1rem;
    font-size: 0.9rem;
}

/* Responsividade */
@media (max-width: 992px) {
    .row > .col-lg-3.col-md-4 {
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .card-header h4 {
        margin-bottom: 0.75rem;
    }

    .card-header div {
        width: 100%;
    }

    .card-header .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .col-md-6.text-md-end {
        text-align: left !important;
        margin-top: 0.75rem;
    }

    .table thead th {
        white-space: nowrap;
    }

    .row > .col-lg-3.col-md-4 {
        max-width: 100%;
    }

    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
    }
}

/* Estilo para mensagens de alerta vazias */
.alert-empty-result {
    border-radius: 8px;
    padding: 30px;
    background-color: #f8fafc;
    border: 1px dashed #cbd5e0;
    text-align: center;
}

.alert-empty-result i {
    font-size: 3rem;
    color: #a0aec0;
    margin-bottom: 1rem;
    display: block;
}

/* Estilo para botão de limpar filtros */
.btn-limpar-filtro {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background-color: #f1f5f9;
    color: #64748b;
    border-radius: 9999px;
    margin-left: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-limpar-filtro:hover {
    background-color: #e2e8f0;
    color: #475569;
}

.btn-limpar-filtro i {
    margin-right: 0.25rem;
    font-size: 0.7rem;
}