/*
 * NutriElit - Premium Radical Overhaul (Fase 6)
 * Archivo: style_v2.css
 * Estética: PWA B2B2C Moderna, Neumorphism Suave, Tarjetas Flotantes y Radios Extremos.
 */

/* ========================================================================= */
/* 1. IMPORTACIONES & VARIABLES GLOBALES                                     */
/* ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Paleta Premium - Fresh UI */
    --bg-body-light: #F4F7FB;
    --bg-card-light: #FFFFFF;
    
    --primary: #52B788;       /* Verde vibrante principal */
    --primary-hover: #40916C;
    --secondary: #2D6A4F;     /* Verde bosque profundo (Acentos) */
    
    --text-dark: #1E293B;     /* Texto principal (Casi negro) */
    --text-muted: #64748B;    /* Texto secundario (Gris azulado) */
    
    --sidebar-bg: #2B2130;    /* Púrpura/Charcoal ultra oscuro para el menú lateral */
    --sidebar-text: #E2E8F0;  /* Texto del sidebar más claro para mejor contraste */
    --sidebar-active: #52B788;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    --border-soft: rgba(0, 0, 0, 0.04);
    
    /* Geometría Radical */
    --radius-sm: 12px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-pill: 100px;
    
    /* Sombras Elevadas (Glass/Neumorphism) */
    --shadow-float: 0 10px 40px -10px rgba(0,0,0,0.08);
    --shadow-lift: 0 20px 40px -10px rgba(82, 183, 136, 0.25);
    
    /* Transiciones */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Modo Oscuro Global */
body.dark-mode {
    --bg-body-light: #0B1120;
    --bg-card-light: #151E2F;
    --text-dark: #F8FAFC;
    --text-muted: #94A3B8;
    --border-soft: rgba(255, 255, 255, 0.05);
    --shadow-float: 0 10px 40px -10px rgba(0,0,0,0.5);
    --sidebar-bg: #070B14;
}

/* ========================================================================= */
/* 2. OVERRIDES BASE Y TIPOGRAFÍA                                            */
/* ========================================================================= */
body {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    background-color: var(--bg-body-light);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-dark);
}

/* ========================================================================= */
/* 3. FLUID CARDS (Adiós Bootstrap Default)                                  */
/* ========================================================================= */
.card {
    background-color: var(--bg-card-light) !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-float) !important;
    transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px -10px rgba(0,0,0,0.12) !important;
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-soft) !important;
    padding: 1.5rem !important;
}

.card-body {
    padding: 1.5rem !important;
}

/* Interiores de Tarjetas rediseñados */
.list-group-item {
    border: none !important;
    border-bottom: 1px solid var(--border-soft) !important;
    background: transparent !important;
    padding: 1rem 0 !important;
    color: var(--text-dark);
}

.list-group-item:last-child {
    border-bottom: none !important;
}

/* ========================================================================= */
/* 4. BOTONES "PILL" & CONTROLES                                             */
/* ========================================================================= */
.btn {
    border-radius: var(--radius-pill) !important;
    font-weight: 600 !important;
    padding: 0.6rem 1.5rem !important;
    letter-spacing: 0.3px;
    transition: all var(--transition-bounce) !important;
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
    color: white !important;
}

.btn-primary:hover {
    box-shadow: var(--shadow-lift) !important;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669) !important;
}

.btn-outline-primary {
    background: transparent !important;
    border: 2px solid var(--primary) !important;
    color: var(--primary) !important;
    box-shadow: none !important;
}

.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: white !important;
    box-shadow: var(--shadow-lift) !important;
}

/* Inputs Circulares */
.form-control, .form-select {
    border-radius: var(--radius-md) !important;
    border: 2px solid transparent !important;
    background-color: rgba(0,0,0,0.03) !important;
    padding: 0.8rem 1.2rem !important;
    color: var(--text-dark) !important;
    font-weight: 500;
    transition: all var(--transition-fast) !important;
    box-shadow: none !important;
}

body.dark-mode .form-control, body.dark-mode .form-select {
    background-color: rgba(255,255,255,0.05) !important;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-card-light) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(82, 183, 136, 0.15) !important;
}

/* ========================================================================= */
/* 5. SIDEBAR Y LAYOUT PRINCIPAL (Animaciones)                               */
/* ========================================================================= */
.sidebar {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-text-override {
    color: #F8FAFC !important; /* Fix específico para rol demasiado oscuro */
}

.sidebar-link {
    color: var(--sidebar-text) !important;
    opacity: 0.8;
}

.sidebar-link:hover {
    opacity: 1;
    background-color: rgba(255,255,255,0.08) !important;
    transform: translateX(5px); /* Micro-interacción */
}

.sidebar-link.active {
    opacity: 1;
    background-color: rgba(82, 183, 136, 0.15) !important;
    color: var(--sidebar-active) !important;
    border-left: 4px solid var(--sidebar-active) !important;
}

/* ========================================================================= */
/* 6. TABLAS REDISEÑADAS (Directorios)                                       */
/* ========================================================================= */
.table {
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
    color: var(--text-dark) !important;
}

.table th {
    border: none !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding-bottom: 0px !important;
}

.table td {
    background: var(--bg-card-light) !important;
    border-top: 1px solid var(--border-soft) !important;
    border-bottom: 1px solid var(--border-soft) !important;
    padding: 1rem !important;
    vertical-align: middle;
}

.table tr td:first-child {
    border-left: 1px solid var(--border-soft) !important;
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.table tr td:last-child {
    border-right: 1px solid var(--border-soft) !important;
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.table tr:hover td {
    background-color: rgba(82, 183, 136, 0.05) !important;
}

/* Badges */
.badge {
    padding: 0.5em 0.8em !important;
    border-radius: var(--radius-pill) !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
}

/* ========================================================================= */
/* 7. UTILIDADES                                                             */
/* ========================================================================= */
.blur-backdrop {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}
body.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.2);
}

/* Float Animation para contenedores especiales */
.floating-element {
    animation: floating 3s ease-in-out infinite;
}
@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Swithes form check responsives */
.form-check-input {
    width: 2.5em !important;
    height: 1.25em !important;
}

.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}
