/**
 * ============================================================================
 * ESTILOS PERSONALIZADOS - PUI Interfaz Institucional
 * ============================================================================
 * 
 * Archivo de estilos CSS personalizado que complementa Bootstrap 5.
 * Define la paleta de colores, tipografía y componentes específicos
 * de la interfaz de la Plataforma Única de Identidad.
 * 
 * @author  Institución Diversa
 * @version 2.3.0
 */

/* ============================================================================
   VARIABLES CSS - PALETA DE COLORES
   ============================================================================ */

:root {
    /* Color primario institucional */
    --pui-primary: #1a365d;
    --pui-primary-light: #2c5282;
    --pui-primary-dark: #0f2440;
    
    /* Color secundario */
    --pui-secondary: #4a90d9;
    --pui-secondary-light: #63a4e8;
    
    /* Color de acento */
    --pui-accent: #e53e3e;
    
    /* Colores de estado */
    --pui-success: #38a169;
    --pui-warning: #d69e2e;
    --pui-danger: #e53e3e;
    --pui-info: #3182ce;
    
    /* Neutros */
    --pui-bg-light: #f7fafc;
    --pui-bg-sidebar: #f8f9fa;
    --pui-border: #e2e8f0;
    --pui-text-primary: #1a202c;
    --pui-text-secondary: #718096;
    
    /* Espaciado */
    --pui-navbar-height: 56px;
    --pui-sidebar-width: 240px;
}

/* ============================================================================
   ESTILOS BASE
   ============================================================================ */

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--pui-bg-light);
    color: var(--pui-text-primary);
}

/* ============================================================================
   NAVBAR PERSONALIZADA
   ============================================================================ */

.bg-primary-custom {
    background-color: var(--pui-primary) !important;
}

.btn-primary-custom {
    background-color: var(--pui-primary);
    border-color: var(--pui-primary);
    color: #fff;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover,
.btn-primary-custom:focus {
    background-color: var(--pui-primary-light);
    border-color: var(--pui-primary-light);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
}

.btn-primary-custom:disabled {
    background-color: var(--pui-primary);
    border-color: var(--pui-primary);
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.text-primary-custom {
    color: var(--pui-primary) !important;
}

.text-light-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ============================================================================
   CONTENIDO PRINCIPAL
   ============================================================================ */

.main-content {
    padding-top: var(--pui-navbar-height);
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.sidebar {
    position: sticky;
    top: var(--pui-navbar-height);
    height: calc(100vh - var(--pui-navbar-height));
    overflow-y: auto;
    background-color: var(--pui-bg-sidebar);
    padding-top: 1rem;
}

.sidebar .nav-link {
    color: var(--pui-text-secondary);
    padding: 0.6rem 1rem;
    margin: 0.1rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(26, 54, 93, 0.08);
    color: var(--pui-primary);
}

.sidebar .nav-link.active {
    background-color: var(--pui-primary);
    color: #fff;
    font-weight: 600;
}

.sidebar .nav-link.active i {
    color: #fff;
}

.sidebar-heading {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    font-weight: 700;
}

/* ============================================================================
   PANTALLA DE LOGIN
   ============================================================================ */

.icono-login {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--pui-primary), var(--pui-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icono-login i {
    font-size: 2rem;
    color: #fff;
}

/* ============================================================================
   TARJETAS Y PANELES
   ============================================================================ */

.card {
    border-radius: 0.5rem;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card-header {
    font-weight: 600;
    font-size: 0.95rem;
}

.card-header.bg-primary-custom {
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

/* ============================================================================
   TABLAS
   ============================================================================ */

.table th {
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: var(--pui-text-secondary);
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(26, 54, 93, 0.03);
}

/* ============================================================================
   FORMULARIOS
   ============================================================================ */

.form-control:focus,
.form-select:focus {
    border-color: var(--pui-secondary);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 217, 0.15);
}

.form-label {
    font-size: 0.875rem;
    color: var(--pui-text-primary);
    margin-bottom: 0.3rem;
}

.form-text {
    font-size: 0.75rem;
}

/* ============================================================================
   BADGES DE SEXO
   ============================================================================ */

.badge-hombre {
    background-color: #3182ce;
    color: #fff;
}

.badge-mujer {
    background-color: #d53f8c;
    color: #fff;
}

.badge-otro {
    background-color: #718096;
    color: #fff;
}

/* ============================================================================
   BIOMÉTRICOS - PREVIEWS
   ============================================================================ */

.foto-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast {
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================================================
   BADGES DE FASES
   ============================================================================ */

.badge.rounded-circle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        height: auto;
        padding-bottom: 1rem;
    }
    
    .sidebar .nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .sidebar .nav-item {
        flex: 1 1 auto;
    }
    
    .sidebar .nav-link {
        text-align: center;
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .sidebar .nav-link i {
        display: block;
        margin-bottom: 0.2rem;
        margin-right: 0 !important;
    }
    
    .navbar-brand span.d-none {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }
    
    .foto-thumb {
        width: 60px;
        height: 60px;
    }
}

/* ============================================================================
   ANIMACIONES DE CARGA
   ============================================================================ */

.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.25rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================================
   UTILIDADES ADICIONALES
   ============================================================================ */

.cursor-pointer {
    cursor: pointer;
}

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

/* Scrollbar personalizado */
.sidebar::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.sidebar::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background-color: transparent;
}
