/* ============================================
   SIDEBAR - SKILLTRACK
   ============================================ */

.sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
    color: white;
    padding: 16px 12px;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: relative;
    overflow-y: scroll;
    overflow-x: hidden;
    border-radius: 0;
    flex-shrink: 0;
    max-height: calc(100vh - 80px);
    scrollbar-width: auto;
    scrollbar-color: rgba(251, 191, 36, 0.6) rgba(0,0,0,0.2);
}

/* Estilos del scrollbar para navegadores webkit (Chrome, Safari, Edge) */
.sidebar::-webkit-scrollbar {
    width: 12px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.25);
    border-radius: 6px;
    margin: 8px 0;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.6);
    border-radius: 6px;
    border: 2px solid rgba(0,0,0,0.25);
    transition: all 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(251, 191, 36, 0.8);
    border-color: rgba(0,0,0,0.3);
}

.sidebar::-webkit-scrollbar-thumb:active {
    background: rgba(251, 191, 36, 1);
}

/* Sidebar legacy - mantener compatibilidad */
.sidebar.legacy {
    width: 180px;
    min-height: calc(100vh - 100px);
    background-color: #2e3d66;
    padding: 15px 10px 10px 10px;
    border-radius: 10px 0 0 10px;
    justify-content: space-between;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

/* Enlaces del sidebar */
.sidebar .nav-link {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    border-left: 3px solid transparent;
    margin: 2px 0;
}

/* Enlaces legacy del sidebar */
.sidebar.legacy .nav-link {
    font-size: 1rem;
    padding: 8px 0 8px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    border-left: none;
    margin: 0;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left-color: #fbbf24;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sidebar.legacy .nav-link:hover {
    background: #1b2a4a;
    color: #ffc107;
    transform: none;
    box-shadow: none;
}

.sidebar .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: #fbbf24;
    border-left-color: #fbbf24;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.sidebar.legacy .nav-link.active {
    background: #1b2a4a;
    color: #ffc107;
    box-shadow: none;
}

.sidebar .nav-link .bi {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    margin-right: 12px;
}

.sidebar.legacy .bi {
    font-size: 1.2rem;
}

/* Submenús del sidebar */
.sidebar .submenu {
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
    margin: 4px 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar .submenu .nav-link {
    margin: 0;
    border-radius: 0;
    padding: 8px 16px 8px 32px;
    font-size: 0.9rem;
    border-left: none;
}

.sidebar .submenu .nav-link:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(3px);
}

.sidebar .submenu-toggle {
    cursor: pointer;
    user-select: none;
}

.sidebar .submenu-toggle .bi-chevron-down {
    transition: transform 0.3s ease;
}

.sidebar .submenu-toggle.collapsed .bi-chevron-down {
    transform: rotate(-90deg);
}

/* Estados especiales del sidebar */
.sidebar-disabled {
    pointer-events: none;
    opacity: 0.5;
}

.sidebar-disabled .nav-link {
    pointer-events: none;
    color: #aaa !important;
}

.sidebar-disabled .nav-link[href*="Responsables"] {
    pointer-events: auto;
    color: #fff !important;
    font-weight: bold;
}

/* Sección legal del sidebar */
.sidebar-legal {
    border-top: 1px solid #3a4a6a;
    margin-top: 20px;
    padding-top: 10px;
}

.sidebar-legal a {
    color: #b0b8c1 !important;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    font-size: 0.95em;
    transition: color 0.2s;
}

.sidebar-legal a:hover {
    color: #ffc107 !important;
}

/* Notificaciones en el sidebar */
.sidebar .nav-link .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.sidebar .nav-link .badge.bg-warning {
    animation: pulseWarning 2s infinite;
}

/* Animaciones para notificaciones */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

@keyframes pulseWarning {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}
