/* Estilos personalizados para o Sistema de Controle de Demandas */

/* Login fullscreen */
.login-fullscreen {
    min-height: 100vh;
}

.login-form-container {
    max-width: 400px;
    width: 100%;
    padding: 2rem;
}

.cadastro-form-container {
    max-width: 800px;
    width: 100%;
    padding: 2rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    overflow-y: auto; /* Adiciona scroll vertical */
    overflow-x: hidden; /* Remove scroll horizontal */
    max-height: 100vh; /* Limita altura à viewport */
    width: 280px; /* Define largura fixa */
}

/* Melhora o estilo da scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Container do conteúdo da sidebar */
.sidebar-content {
    padding-bottom: 2rem; /* Espaço no final */
}

/* Títulos de seção da sidebar */
.sidebar-heading {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Destaque especial para o menu de permissões */
.permissions-highlight {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin: 0.25rem 0.5rem;
}

@media (max-width: 767.98px) {
    .sidebar {
        top: 5rem;
    }
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
}

/* Cards do dashboard */
.card {
    border: none;
    border-radius: 0.75rem;
}

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .login-form-container,
    .cadastro-form-container {
        padding: 1rem;
    }
    
    .col-md-6:last-child,
    .col-md-4:last-child {
        display: none;
    }
}

/* Formulários */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    opacity: .65;
    transform: scale(.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Alertas */
.alert {
    border-radius: 0.75rem;
}

/* Botões */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Tabelas */
.table {
    border-radius: 0.75rem;
    overflow: hidden;
}

.table th {
    border-top: none;
    font-weight: 600;
}

.table:not(.table-dark) th {
    background-color: #f8f9fa;
}

/* Força visualização do table-dark - CSS mais específico */
.table.table-hover thead.table-dark th {
    background-color: #212529 !important;
    color: #ffffff !important;
    border-color: #32383e !important;
    font-weight: 600 !important;
}

.table-dark th {
    background-color: #212529 !important;
    color: #ffffff !important;
    border-color: #32383e !important;
}

.table-dark td {
    background-color: #212529;
    color: #ffffff;
    border-color: #32383e;
}

/* Especificidade extra para cabeçalhos */
thead.table-dark th {
    background-color: #212529 !important;
    color: #ffffff !important;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Cores customizadas */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

/* Hover effects */
.list-group-item-action:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
    transition: all 0.2s ease;
}

/* Icons */
.bi {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* Custom scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #2d3748;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Card hover effect */
.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Estilos para sidebar com submenus colapsados */
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}

/* Botões de expansão dos submenus */
.sidebar .btn-link {
    border: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.sidebar .btn-link:focus {
    box-shadow: none !important;
}

/* Submenus colapsados */
.sidebar .collapse .nav-link {
    padding: 0.5rem 1rem 0.5rem 2rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7) !important;
}

.sidebar .collapse .nav-link:hover {
    color: rgba(255, 255, 255, 0.95) !important;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Ícones dos submenus */
.sidebar .collapse .nav-link i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
}

/* Animação para as setas de expansão */
.sidebar [data-bs-toggle="collapse"] i {
    transition: transform 0.2s ease;
}

.sidebar [data-bs-toggle="collapse"][aria-expanded="true"] i {
    transform: rotate(180deg);
}
