/* ACS Painel - Estilos Customizados */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
}

.min-vh-100 {
    min-height: 100vh;
}

/* Cards */
.card {
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0052a3);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    padding: 1.5rem;
}

/* Estatísticas */
.stat-card {
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card.info {
    border-left-color: var(--info-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Badges de nível */
.badge-nivel-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.badge-nivel-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.badge-nivel-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Badges de risco */
.badge-risco-baixo {
    background-color: #28a745;
}

.badge-risco-intermediario {
    background-color: #ffc107;
    color: #000;
}

.badge-risco-alto {
    background-color: #dc3545;
}

/* Sidebar */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--cor-personalizada) 0%, var(--cor-personalizada) 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 0.25rem 0;
    transition: all 0.3s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
}

/* Tabelas */
.table-custom {
    border-radius: 8px;
    overflow: hidden;
}

.table-custom thead {
    background: linear-gradient(135deg, var(--primary-color), #0052a3);
    color: white;
}

.table-custom tbody tr {
    transition: background-color 0.2s;
}

.table-custom tbody tr:hover {
    background-color: rgba(0, 102, 204, 0.05);
}

/* Botões */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Gráficos */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.percentage-display {
    font-size: 3rem;
    font-weight: bold;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nivel-display {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-top: 1rem;
}

.nivel-avancado {
    background-color: #28a745;
    color: white;
}

.nivel-intermediario {
    background-color: #ffc107;
    color: #000;
}

.nivel-basico {
    background-color: #fd7e14;
    color: white;
}

.nivel-inicial {
    background-color: #dc3545;
    color: white;
}

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

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

/* Menu Hambúrguer */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: linear-gradient(135deg, var(--cor-personalizada) 0%, var(--cor-personalizada) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}


.menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
/* Customizando a Barra de Rolagem do Menu */

/* Personalizando a barra de rolagem no Chrome, Edge e Safari */
.sidebar::-webkit-scrollbar {
    width: 8px; /* Largura da barra de rolagem */
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--cor-personalizada); /* Cor do "thumb" (parte da barra que você arrasta) */
    border-radius: 10px; /* Bordas arredondadas no thumb */
}

.sidebar::-webkit-scrollbar-track {
    background-color: #f1f1f1; /* Cor de fundo da trilha (parte da barra onde o thumb desliza) */
    border-radius: 10px; /* Bordas arredondadas na trilha */
}

/* Caso queira adicionar um efeito de hover (quando passar o mouse por cima) */
.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-color); /* Muda a cor quando o usuário passa o mouse */
}


/* Mostrar o botão hambúrguer apenas no mobile */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        min-height: 100vh;  /* Garante que a sidebar ocupe toda a altura da tela */
        z-index: 1050;
        transition: left 0.3s ease-in-out;
        overflow-y: auto;  /* Adiciona rolagem vertical se necessário */
        max-height: 100vh;  /* Garante que a sidebar não ultrapasse a altura da tela */
    }

    .sidebar.active {
        left: 0;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
    }

    /* Adiciona um fundo escurecido quando a sidebar está ativa */
    .sidebar-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    main {
        margin-left: 0 !important;
        width: 100%;
    }

    /* Ajustes para garantir que o conteúdo da sidebar se comporte de forma adequada */
    .sidebar ul {
        padding-top: 20px;  /* Adiciona um espaço entre o topo e os itens */
    }
  
    .stat-number {
        font-size: 2rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .card-header h5 {
        margin-bottom: 1rem;
    }
    
    .card-header .btn-group,
    .card-header > div {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .card-header .btn {
        flex: 1;
        min-width: 100px;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .stat-number {
        font-size: 1.5rem;
    }
    
    .percentage-display {
        font-size: 2rem;
        padding: 1rem;
    }
    
    .nivel-display {
        font-size: 1.2rem;
        padding: 0.5rem 1rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alertas customizados */
.alert {
    border-radius: 8px;
    border: none;
}

.alert i {
    font-size: 1.2rem;
}