/* Estilos básicos */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    padding-top: 20px;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    color: #343a40;
    margin-bottom: 30px;
}

.form-control:focus {
    border-color: #6c757d;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.25);
}

.btn-primary {
    background-color: #343a40;
    border-color: #343a40;
}

.btn-primary:hover {
    background-color: #23272b;
    border-color: #23272b;
}

.alert {
    border-radius: 5px;
    margin-bottom: 20px;
}

.card {
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.card-header {
    font-weight: bold;
}

.table-responsive {
    margin-top: 20px;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
}

/* Estilos para a Home do Workspace */
.workspace-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stats-card .card-body {
    padding: 20px;
}

.stats-card i.display-4 {
    opacity: 0.7;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline:before {
    content: '';
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #dee2e6, transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 15px;
}

.timeline-icon {
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Badges personalizados */
.badge-admin {
    background-color: #dc3545;
}

.badge-edicao {
    background-color: #17a2b8;
}

.badge-leitura {
    background-color: #6c757d;
}

/* Cards hover */
.hover-card {
    transition: all 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ORDENAÇÃO DE TABELAS - PARA TODAS AS PÁGINAS - AJUSTADO */
.sort-icon {
    font-size: 0.8rem;
    margin-left: 5px;
    opacity: 0;
    /* Começa invisível */
    transition: opacity 0.3s ease, color 0.3s ease;
    display: inline-block;
    width: 16px;
    text-align: center;
    font-family: Arial, sans-serif;
    position: relative;
    color: inherit;
}

/* IMPORTANTE: Remove completamente qualquer conteúdo do Bootstrap */
.sort-icon.bi::before,
.bi-arrow-down-up::before,
.bi-arrow-up::before,
.bi-arrow-down::before {
    content: "" !important;
    display: none !important;
}

/* Remove o pseudo-elemento ::before do sort-icon pois vamos controlar via JS */
.sort-icon::before {
    content: "" !important;
    display: none;
}

/* Mostra o ícone neutro APENAS quando o mouse passa sobre o cabeçalho E não está ativo */
th[data-sort]:hover .sort-icon:not(.active) {
    opacity: 0.5;
    color: inherit;
}

/* Quando a coluna está sendo ordenada (ativa), o JS adiciona a classe .active */
.sort-icon.active {
    opacity: 1 !important;
    color: #007bff !important;
    font-weight: bold !important;
}

/* Estilos para os estados de ordenação */
th[data-sort].sort-asc,
th[data-sort].sort-desc {
    position: relative;
}

/* Remove qualquer conteúdo de pseudo-elementos nos estados ativos */
th[data-sort].sort-asc .sort-icon::before,
th[data-sort].sort-desc .sort-icon::before {
    content: "" !important;
    display: none;
}

th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px !important;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

th[data-sort]:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Garante que quando estiver ordenando, o ícone fique visível mesmo sem hover */
th[data-sort].sort-asc .sort-icon,
th[data-sort].sort-desc .sort-icon {
    opacity: 1 !important;
}

/* Remove qualquer efeito de hover quando está ativo */
th[data-sort].sort-asc:hover .sort-icon,
th[data-sort].sort-desc:hover .sort-icon {
    opacity: 1 !important;
    color: #007bff !important;
}

/* Responsividade - para telas menores */
@media (max-width: 768px) {
    .sort-icon {
        opacity: 0.2;
        /* Sempre um pouco visível em telas pequenas */
    }

    th[data-sort]:hover .sort-icon:not(.active) {
        opacity: 0.6;
    }

    .sort-icon.active {
        opacity: 1 !important;
    }
}

/* Ajustes gerais para evitar conflitos */
th[data-sort] .bi {
    display: none !important;
    /* Esconde qualquer ícone do Bootstrap */
}

/* Garante que o sort-icon tenha prioridade */
.sort-icon {
    display: inline-block !important;
    visibility: visible !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .workspace-header {
        padding: 15px;
    }

    .stats-card .display-4 {
        font-size: 2rem;
    }
}