/* css/styles.css - VERSIÓN DEFINITIVA CON VARIABLES CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz@14..32&display=swap');

/* ========================================================
   1. DEFINICIÓN DE VARIABLES (TEMA)
   ======================================================== */
:root {
    --color-primario: #6366f1;
    --color-secundario: #9333ea;
    --color-fondo: #0f172a;
    --color-texto: #e2e8f0;
    --color-borde: rgba(255, 255, 255, 0.12);
    --color-glass: rgba(255, 255, 255, 0.08);
    --color-glass-dark: rgba(15, 23, 42, 0.85);
    --color-input-bg: rgba(255, 255, 255, 0.05);
    --color-input-border: rgba(255, 255, 255, 0.15);
    --color-scrollbar-thumb: rgba(99, 102, 241, 0.6);
    --color-scrollbar-track: rgba(255, 255, 255, 0.05);
    --color-calendar-day-bg: rgba(255, 255, 255, 0.05);
    --color-calendar-day-hover: rgba(99, 102, 241, 0.3);
    --color-calendar-selected: #818cf8;
    --color-calendar-cita-border: #f59e0b;
    --color-badge-pulse: #ef4444;
    --color-badge-shadow: rgba(239, 68, 68, 0.6);
    --fuente-principal: 'Inter', sans-serif;
}

/* ========================================================
   2. RESET Y TAMAÑO BASE
   ======================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 20px !important;
}

body {
    font-family: var(--fuente-principal);
    background: var(--color-fondo);
    color: var(--color-texto);
    font-size: 1.1rem !important;
    line-height: 1.6;
}

/* ========================================================
   3. TÍTULOS Y TEXTOS GRANDES
   ======================================================== */
h1, .h1 { font-size: 2.5rem !important; }
h2, .h2 { font-size: 2rem !important; }
h3, .h3 { font-size: 1.7rem !important; }
h4, .h4 { font-size: 1.4rem !important; }
h5, .h5 { font-size: 1.2rem !important; }
h6, .h6 { font-size: 1.1rem !important; }

p, span, a, li, td, th, label, input, textarea, select, button, div:not(.calendar-day):not(.glass-card) {
    font-size: 1.1rem !important;
}

/* ========================================================
   4. ANULAR CLASES DE TAILWIND (textos pequeños)
   ======================================================== */
.text-xs { font-size: 0.85rem !important; }
.text-sm { font-size: 0.95rem !important; }
.text-base { font-size: 1.1rem !important; }
.text-lg { font-size: 1.3rem !important; }
.text-xl { font-size: 1.6rem !important; }
.text-2xl { font-size: 2rem !important; }
.text-3xl { font-size: 2.5rem !important; }
.text-4xl { font-size: 3rem !important; }
.text-5xl { font-size: 3.5rem !important; }

/* ========================================================
   5. NAVBAR
   ======================================================== */
nav, nav * { font-size: 0.95rem !important; }
nav .text-xl { font-size: 1.4rem !important; }
nav .text-sm { font-size: 0.95rem !important; }
nav .text-xs { font-size: 0.8rem !important; }

/* ========================================================
   6. SIDEBAR
   ======================================================== */
.menu-item { font-size: 0.95rem !important; }
.menu-item .text-xs { font-size: 0.8rem !important; }
.menu-item .text-lg { font-size: 1.2rem !important; }

/* ========================================================
   7. TARJETAS (glassmorphism)
   ======================================================== */
.glass-card {
    background: var(--color-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--color-borde);
    border-radius: 1.5rem;
    padding: 1.8rem;
    font-size: 1.1rem !important;
}
.glass-card-dark {
    background: var(--color-glass-dark);
    backdrop-filter: blur(12px);
    border: 1px solid var(--color-borde);
    border-radius: 1.5rem;
    padding: 1.8rem;
    font-size: 1.1rem !important;
}
.glass-card .text-3xl { font-size: 2.5rem !important; }
.glass-card .text-2xl { font-size: 2rem !important; }
.glass-card .text-xl { font-size: 1.6rem !important; }
.glass-card .text-lg { font-size: 1.3rem !important; }

/* ========================================================
   8. BOTONES E INPUTS
   ======================================================== */
button, .btn {
    font-size: 0.95rem !important;
    padding: 0.6rem 1.2rem;
    border-radius: 0.8rem;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    background: var(--color-primario);
    color: white;
    font-weight: 500;
}
button:hover, .btn:hover {
    background: var(--color-secundario);
}

input, textarea, select {
    font-size: 1rem !important;
    padding: 0.6rem 0.8rem;
    border-radius: 0.8rem;
    border: 1px solid var(--color-input-border);
    background: var(--color-input-bg);
    color: var(--color-texto);
    width: 100%;
}

/* ========================================================
   9. CALENDARIO
   ======================================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.calendar-day {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--color-calendar-day-bg);
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem !important;
}
.calendar-day:hover {
    background: var(--color-calendar-day-hover);
}
.calendar-day.selected {
    background: var(--color-calendar-selected);
    color: white;
}
.calendar-day.has-cita {
    border: 2px solid var(--color-calendar-cita-border);
}

/* ========================================================
   10. SCROLLBAR
   ======================================================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-scrollbar-track); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: var(--color-scrollbar-thumb); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-scrollbar-thumb); opacity: 0.8; }

/* ========================================================
   11. ANIMACIONES
   ======================================================== */
.slide-in {
    animation: slideIn 0.3s ease-out forwards;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--color-badge-shadow); }
    50% { box-shadow: 0 0 0 8px var(--color-badge-shadow); }
}
.sidebar-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================
   12. RESPONSIVE (móviles)
   ======================================================== */
@media (max-width: 640px) {
    html { font-size: 17px !important; }
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.6rem !important; }
    .glass-card { padding: 1.2rem !important; }
    .text-xl { font-size: 1.3rem !important; }
    .text-2xl { font-size: 1.6rem !important; }
    .text-3xl { font-size: 2rem !important; }
}

/* ========================================================
   13. UTILIDADES ADICIONALES (con variables)
   ======================================================== */
.text-white { color: white !important; }
.text-slate-300 { color: #cbd5e1 !important; }
.text-slate-400 { color: #94a3b8 !important; }
.text-slate-500 { color: #64748b !important; }

/* Estilos que usan el color primario (se aplican con variables) */
.bg-indigo-500 {
    background-color: var(--color-primario) !important;
}
.bg-indigo-500:hover {
    background-color: var(--color-secundario) !important;
}
.text-indigo-400 {
    color: var(--color-primario) !important;
}
.border-indigo-500 {
    border-color: var(--color-primario) !important;
}
.bg-indigo-500\/20 {
    background-color: var(--color-primario) !important;
    opacity: 0.2;
}
.text-indigo-300 {
    color: var(--color-primario) !important;
    opacity: 0.7;
}
.hover\:bg-indigo-500\/30:hover {
    background-color: var(--color-primario) !important;
    opacity: 0.3;
}

/* Estilos que usan color secundario */
.bg-purple-500 {
    background-color: var(--color-secundario) !important;
}
.text-purple-400 {
    color: var(--color-secundario) !important;
}

/* Estilos de fondo de la aplicación */
.bg-slate-800\/80 {
    background: rgba(30, 41, 59, 0.8) !important;
}
.bg-slate-900\/50 {
    background: rgba(15, 23, 42, 0.5) !important;
}
.bg-slate-800\/40 {
    background: rgba(30, 41, 59, 0.4) !important;
}
.border-slate-700\/50 {
    border-color: rgba(51, 65, 85, 0.5) !important;
}

/* ========================================================
   VARIABLES CSS PARA PERSONALIZACIÓN (COMPLETO)
   ======================================================== */
:root {
    --color-primario: #6366f1;
    --color-secundario: #ec4899;
    --color-fondo: #0f172a;
    --color-texto: #e2e8f0;
    --color-borde: rgba(255,255,255,0.12);
    --color-glass: rgba(255,255,255,0.08);
    --color-borde-input: rgba(255,255,255,0.15);
    --gradiente-primario: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradiente-secundario: linear-gradient(135deg, #ec4899, #f472b6);
    --gradiente-fondo: none;
    --logo-url: none;
    --fondo-url: none;
    --video-url: none;
    --fuente-principal: 'Inter', sans-serif;
    --tamaño-base: 20px;
    --radio-borde: 12px;
    --sombra: 0 4px 8px rgba(0,0,0,0.3);
    --opacidad-glass: 0.08;
    --hover-escala: 1.02;
    --hover-brillo: 1.05;
    --animacion-tipo: fade;
    --animacion-duracion: 300ms;
    --blur-fondo: 0px;
    --transicion-global: 0.3s ease;
}

/* Aplicar fuente y tamaño base */
html {
    font-size: var(--tamaño-base);
    transition: all var(--transicion-global);
}
body {
    font-family: var(--fuente-principal);
    background-color: var(--color-fondo);
    background-image: var(--fondo-url), var(--gradiente-fondo);
    background-size: cover, 100% 100%;
    background-position: center, center;
    background-attachment: fixed, fixed;
    color: var(--color-texto);
    transition: all var(--transicion-global);
}

/* Fondo de video */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: var(--video-url);
    background-size: cover;
    background-position: center;
    pointer-events: none;
    opacity: 0.8;
}
body.has-video {
    background: transparent;
}

/* Desenfoque de fondo (si se usa imagen) */
body.blur-fondo {
    backdrop-filter: blur(var(--blur-fondo));
}

/* Tarjetas con variables */
.glass-card {
    background: rgba(255,255,255, var(--opacidad-glass));
    backdrop-filter: blur(12px);
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-borde);
    box-shadow: var(--sombra);
    transition: all var(--transicion-global);
}

/* Botones con gradiente */
button, .btn {
    background: var(--gradiente-primario);
    border-radius: var(--radio-borde);
    border: none;
    color: white;
    transition: all var(--animacion-duracion) ease;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
}
button:hover, .btn:hover {
    transform: scale(var(--hover-escala));
    filter: brightness(var(--hover-brillo));
}

/* Inputs */
input, textarea, select {
    border: 1px solid var(--color-borde-input);
    border-radius: var(--radio-borde);
    background: rgba(255,255,255,0.05);
    color: var(--color-texto);
    transition: all var(--transicion-global);
}
input:focus, textarea:focus, select:focus {
    border-color: var(--color-primario);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
}

/* Efectos de hover para tarjetas */
.glass-card:hover {
    transform: scale(var(--hover-escala));
    filter: brightness(var(--hover-brillo));
}

/* Animaciones de entrada */
.slide-in {
    animation: var(--animacion-tipo) var(--animacion-duracion) ease-out forwards;
}
@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-down {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-left {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slide-right {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes zoom {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes bounce {
    0% { opacity: 0; transform: scale(0.5); }
    60% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes rotate {
    from { opacity: 0; transform: rotate(-180deg) scale(0.5); }
    to { opacity: 1; transform: rotate(0deg) scale(1); }
}
@keyframes flip {
    from { opacity: 0; transform: perspective(400px) rotateY(-90deg); }
    to { opacity: 1; transform: perspective(400px) rotateY(0deg); }
}

/* Logo en navbar - TAMAÑO MÁS GRANDE */
.logo-img {
    display: inline-block;
    height: 4rem;   /* 64px */
    width: 4rem;    /* 64px */
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    border-radius: 0.75rem;
}
.logo-img.has-logo i {
    display: none;
}
.logo-img.has-logo {
    background-color: transparent !important;
}
.logo-img.has-logo i {
    display: none;
}

/* ========================================================
   NUEVA CLASE PARA ANIMACIONES AVANZADAS (sin perder nada)
   ======================================================== */
.animate-me {
    opacity: 0;
    animation-fill-mode: forwards;
}
/* ========================================================
   ESTILOS ESPECÍFICOS PARA EL PANEL DE CONFIGURACIÓN
   ======================================================== */
.config-panel .config-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.config-panel .config-section label {
    display: block;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.config-panel .config-section .field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.config-panel .config-section .field-row .field-group {
    flex: 1 1 180px;
    min-width: 140px;
}

.config-panel .config-section .field-row .field-group label {
    font-weight: 400;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.1rem;
}

.config-panel .config-section input[type="text"],
.config-panel .config-section input[type="number"],
.config-panel .config-section textarea,
.config-panel .config-section select {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: #e2e8f0;
    width: 100%;
    font-size: 0.9rem;
    transition: 0.2s;
}

.config-panel .config-section input:focus,
.config-panel .config-section textarea:focus,
.config-panel .config-section select:focus {
    border-color: var(--color-primario);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.config-panel .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.config-panel .checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.85rem;
    color: #cbd5e1;
    transition: 0.2s;
}

.config-panel .checkbox-grid label:hover {
    background: rgba(255, 255, 255, 0.08);
}

.config-panel .checkbox-grid input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-primario);
}

/* Vista previa de animación */
.config-panel .preview-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.config-panel .preview-box button {
    flex-shrink: 0;
}

.config-panel .preview-box .preview-element {
    flex: 1;
    padding: 0.8rem;
    background: rgba(30, 41, 59, 0.4);
    border-radius: 0.5rem;
    text-align: center;
    color: #cbd5e1;
    font-size: 0.9rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}