/**
 * =============================================================================
 * ESTILOS PRINCIPALES DE LA APLICACIÓN (estilos-principales.css)
 * =============================================================================
 * 
 * Define la identidad visual complementaria a Tailwind CSS:
 * - Efectos de glassmorphism y microinteracciones de tarjetas.
 * - Barra de scroll personalizada y estilizada para modo claro y oscuro.
 * - Animaciones de modales, alertas y notificaciones toast.
 * - Variables de color y tipografía para consistencia del sistema de finanzas.
 */

/* -----------------------------------------------------------------------------
 * 1. VARIABLES GLOBALES DE DISEÑO Y TEMAS
 * ----------------------------------------------------------------------------- */
:root {
    --color-emerald-glow: rgba(16, 185, 129, 0.15);
    --color-rose-glow: rgba(244, 63, 94, 0.15);
    --color-blue-glow: rgba(59, 130, 246, 0.15);
    --color-purple-glow: rgba(168, 85, 247, 0.15);
    --sombra-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --sombra-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

.dark {
    --color-emerald-glow: rgba(16, 185, 129, 0.25);
    --color-rose-glow: rgba(244, 63, 94, 0.25);
    --color-blue-glow: rgba(59, 130, 246, 0.25);
    --color-purple-glow: rgba(168, 85, 247, 0.25);
    --sombra-card: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --sombra-card-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

/* -----------------------------------------------------------------------------
 * 2. PERSONALIZACIÓN DE SCROLLBARS
 * ----------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 9999px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* -----------------------------------------------------------------------------
 * 3. TARJETAS FINANCIERAS Y EFECTO GLASSMORFISMO
 * ----------------------------------------------------------------------------- */
.card-finanzas {
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 1rem;
    box-shadow: var(--sombra-card);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .card-finanzas {
    background-color: #0F172A;
    border-color: #1E293B;
}

.card-finanzas:hover {
    box-shadow: var(--sombra-card-hover);
    transform: translateY(-2px);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.dark .glass-panel {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(30, 41, 59, 0.8);
}

/* -----------------------------------------------------------------------------
 * 4. ANIMACIONES DE INTERFAZ (Modales, Toasts, Desvanecimientos)
 * ----------------------------------------------------------------------------- */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

@keyframes pulseSubtle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.anim-modal {
    animation: fadeInScale 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-toast {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* -----------------------------------------------------------------------------
 * 5. BADGES Y ESTADOS FINANCIEROS
 * ----------------------------------------------------------------------------- */
.badge-ingreso {
    background-color: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}
.dark .badge-ingreso {
    background-color: rgba(6, 78, 59, 0.5);
    color: #6EE7B7;
    border-color: #065F46;
}

.badge-gasto {
    background-color: #FFF1F2;
    color: #BE123C;
    border: 1px solid #FECDD3;
}
.dark .badge-gasto {
    background-color: rgba(136, 19, 55, 0.5);
    color: #FDA4AF;
    border-color: #9F1239;
}

.badge-transferencia {
    background-color: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}
.dark .badge-transferencia {
    background-color: rgba(30, 58, 138, 0.5);
    color: #93C5FD;
    border-color: #1E40AF;
}

/* -----------------------------------------------------------------------------
 * 6. AJUSTES DE APEXCHARTS PARA MODO OSCURO
 * ----------------------------------------------------------------------------- */
.apexcharts-tooltip {
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.dark .apexcharts-tooltip {
    background: #0F172A !important;
    border: 1px solid #334155 !important;
    color: #F8FAFC !important;
}

.dark .apexcharts-tooltip-title {
    background: #1E293B !important;
    border-bottom: 1px solid #334155 !important;
    color: #F8FAFC !important;
}

.dark .apexcharts-text {
    fill: #94A3B8 !important;
}

/* -----------------------------------------------------------------------------
 * 7. BOTONES TÁCTILES NEO-ESQUEUMÓRFICOS (Tactile 3D Buttons)
 * ----------------------------------------------------------------------------- */

/* Estilos base comunes para todos los botones táctiles */
.btn-tactil-azul,
.btn-tactil-verde,
.btn-tactil-ambar,
.btn-tactil-purpura,
.btn-tactil-rojo,
button.bg-indigo-600, a.bg-indigo-600,
button.bg-blue-600, a.bg-blue-600,
button.bg-emerald-600, a.bg-emerald-600,
button.bg-emerald-700, a.bg-emerald-700,
button.bg-purple-600, a.bg-purple-600,
button.bg-amber-500, a.bg-amber-500,
button.bg-amber-600, a.bg-amber-600,
button.bg-rose-600, a.bg-rose-600 {
    cursor: pointer;
    border: none !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

/* 1. AZUL / ÍNDIGO */
.btn-tactil-azul,
button.bg-indigo-600, a.bg-indigo-600,
button.bg-blue-600, a.bg-blue-600 {
    background: linear-gradient(180deg, #7c7cff 0%, #5b5bf0 100%) !important;
    box-shadow: inset 0 1px 0 #ffffff59,
                inset 0 -2px 0 #0003,
                0 1px 2px #0006,
                0 8px 24px -6px #5b5bf099 !important;
    color: #ffffff !important;
}
.btn-tactil-azul:hover,
button.bg-indigo-600:hover, a.bg-indigo-600:hover,
button.bg-blue-600:hover, a.bg-blue-600:hover {
    background: linear-gradient(180deg, #8888ff 0%, #6363f5 100%) !important;
    box-shadow: inset 0 1px 0 #ffffff70,
                inset 0 -2px 0 #0004,
                0 2px 4px #0005,
                0 10px 28px -4px #5b5bf0cc !important;
    transform: translateY(-1px);
}
.btn-tactil-azul:active,
button.bg-indigo-600:active, a.bg-indigo-600:active,
button.bg-blue-600:active, a.bg-blue-600:active {
    translate: 0 1px !important;
    box-shadow: inset 0 2px 4px #0004 !important;
    transform: none !important;
}

/* 2. VERDE ESMERALDA */
.btn-tactil-verde,
button.bg-emerald-600, a.bg-emerald-600,
button.bg-emerald-700, a.bg-emerald-700 {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important;
    box-shadow: inset 0 1px 0 #ffffff59,
                inset 0 -2px 0 #0003,
                0 1px 2px #0006,
                0 8px 24px -6px rgba(5, 150, 105, 0.6) !important;
    color: #ffffff !important;
}
.btn-tactil-verde:hover,
button.bg-emerald-600:hover, a.bg-emerald-600:hover,
button.bg-emerald-700:hover, a.bg-emerald-700:hover {
    background: linear-gradient(180deg, #22c55e 0%, #047857 100%) !important;
    box-shadow: inset 0 1px 0 #ffffff70,
                inset 0 -2px 0 #0004,
                0 2px 4px #0005,
                0 10px 28px -4px rgba(5, 150, 105, 0.8) !important;
    transform: translateY(-1px);
}
.btn-tactil-verde:active,
button.bg-emerald-600:active, a.bg-emerald-600:active,
button.bg-emerald-700:active, a.bg-emerald-700:active {
    translate: 0 1px !important;
    box-shadow: inset 0 2px 4px #0004 !important;
    transform: none !important;
}

/* 3. ÁMBAR / DORADO */
.btn-tactil-ambar,
button.bg-amber-500, a.bg-amber-500,
button.bg-amber-600, a.bg-amber-600 {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
    box-shadow: inset 0 1px 0 #ffffff59,
                inset 0 -2px 0 #0003,
                0 1px 2px #0006,
                0 8px 24px -6px rgba(217, 119, 6, 0.6) !important;
    color: #ffffff !important;
}
.btn-tactil-ambar:hover,
button.bg-amber-500:hover, a.bg-amber-500:hover,
button.bg-amber-600:hover, a.bg-amber-600:hover {
    background: linear-gradient(180deg, #fbbf24 0%, #b45309 100%) !important;
    box-shadow: inset 0 1px 0 #ffffff70,
                inset 0 -2px 0 #0004,
                0 2px 4px #0005,
                0 10px 28px -4px rgba(217, 119, 6, 0.8) !important;
    transform: translateY(-1px);
}
.btn-tactil-ambar:active,
button.bg-amber-500:active, a.bg-amber-500:active,
button.bg-amber-600:active, a.bg-amber-600:active {
    translate: 0 1px !important;
    box-shadow: inset 0 2px 4px #0004 !important;
    transform: none !important;
}

/* 4. PÚRPURA / VIOLETA */
.btn-tactil-purpura,
button.bg-purple-600, a.bg-purple-600,
button.bg-purple-700, a.bg-purple-700 {
    background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%) !important;
    box-shadow: inset 0 1px 0 #ffffff59,
                inset 0 -2px 0 #0003,
                0 1px 2px #0006,
                0 8px 24px -6px rgba(126, 34, 206, 0.6) !important;
    color: #ffffff !important;
}
.btn-tactil-purpura:hover,
button.bg-purple-600:hover, a.bg-purple-600:hover,
button.bg-purple-700:hover, a.bg-purple-700:hover {
    background: linear-gradient(180deg, #c084fc 0%, #6b21a8 100%) !important;
    box-shadow: inset 0 1px 0 #ffffff70,
                inset 0 -2px 0 #0004,
                0 2px 4px #0005,
                0 10px 28px -4px rgba(126, 34, 206, 0.8) !important;
    transform: translateY(-1px);
}
.btn-tactil-purpura:active,
button.bg-purple-600:active, a.bg-purple-600:active,
button.bg-purple-700:active, a.bg-purple-700:active {
    translate: 0 1px !important;
    box-shadow: inset 0 2px 4px #0004 !important;
    transform: none !important;
}

/* 5. ROJO / ROSA */
.btn-tactil-rojo,
button.bg-rose-600, a.bg-rose-600,
button.bg-red-600, a.bg-red-600 {
    background: linear-gradient(180deg, #f43f5e 0%, #be123c 100%) !important;
    box-shadow: inset 0 1px 0 #ffffff59,
                inset 0 -2px 0 #0003,
                0 1px 2px #0006,
                0 8px 24px -6px rgba(190, 18, 60, 0.6) !important;
    color: #ffffff !important;
}
.btn-tactil-rojo:hover,
button.bg-rose-600:hover, a.bg-rose-600:hover,
button.bg-red-600:hover, a.bg-red-600:hover {
    background: linear-gradient(180deg, #fb7185 0%, #9f1239 100%) !important;
    box-shadow: inset 0 1px 0 #ffffff70,
                inset 0 -2px 0 #0004,
                0 2px 4px #0005,
                0 10px 28px -4px rgba(190, 18, 60, 0.8) !important;
    transform: translateY(-1px);
}
.btn-tactil-rojo:active,
button.bg-rose-600:active, a.bg-rose-600:active,
button.bg-red-600:active, a.bg-red-600:active {
    translate: 0 1px !important;
    box-shadow: inset 0 2px 4px #0004 !important;
    transform: none !important;
}

/* 6. ESTADO DESHABILITADO */
.btn-tactil-azul:disabled,
.btn-tactil-verde:disabled,
.btn-tactil-ambar:disabled,
.btn-tactil-purpura:disabled,
.btn-tactil-rojo:disabled,
button:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    translate: none !important;
}


