/**
 * Agente Fin Dashboard - Obsidian Engine Styles
 * Glass effects, glows, animations, accessibility
 */

/* ============ Base ============ */
body {
    font-family: 'Inter', sans-serif;
    background: #0c0e12;
    color: #e2e2e8;
}

::selection {
    background: rgba(0, 102, 255, 0.3);
    color: #f8f7ff;
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #0c0e12; }
::-webkit-scrollbar-thumb { background: #424656; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #8c90a1; }

/* ============ Glass Effects ============ */
.glass-card {
    background: rgba(40, 42, 46, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(179, 197, 255, 0.15);
}

.glass-panel {
    background: rgba(40, 42, 46, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* Legacy glass class for backward compatibility */
.glass {
    background: rgba(40, 42, 46, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(179, 197, 255, 0.15);
}

/* ============ Glow Effects ============ */
.glow { box-shadow: 0 0 20px rgba(0, 102, 255, 0.2); }
.glow-line { box-shadow: 0 0 10px rgba(179, 197, 255, 0.2); }
.glow-trail { box-shadow: 0 0 15px rgba(78, 222, 163, 0.5); }
.glow-primary { box-shadow: 0 0 20px rgba(0, 102, 255, 0.2); }
.glow-line-green { box-shadow: 0 0 10px rgba(78, 222, 163, 0.3); }
.glow-line-blue { box-shadow: 0 0 15px rgba(179, 197, 255, 0.2); }
.glow-amber { box-shadow: 0 0 30px rgba(255, 185, 95, 0.15); }
.glow-red { box-shadow: 0 0 30px rgba(255, 180, 171, 0.15); }

/* ============ Gradients ============ */
.bg-obsidian-gradient {
    background: linear-gradient(180deg, #111318 0%, #0c0e12 100%);
}

.card-gradient-black {
    background: linear-gradient(135deg, #1a1c20 0%, #000000 100%);
}

.card-gradient-platinum {
    background: linear-gradient(135deg, #e2e2e8 0%, #8c90a1 100%);
}

/* ============ Animations ============ */
.animate-float { animation: float 6s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
.toast-enter { animation: slideInRight 0.3s ease-out; }
.toast-leave { animation: slideOutRight 0.3s ease-in forwards; }

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}
.pulse-alert::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    border: 2px solid currentColor;
    animation: pulse-ring 2s ease-out infinite;
}

.progress-bar-animated {
    background: linear-gradient(90deg, transparent, rgba(179, 197, 255, 0.3), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}
.animate-shake { animation: shake 0.3s ease-in-out; }

/* ============ Focus Visible (Accessibility) ============ */
*:focus-visible {
    outline: 2px solid rgba(179, 197, 255, 0.7);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(179, 197, 255, 0.7);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* ============ Reduced Motion (Accessibility) ============ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .animate-float,
    .animate-spin,
    .animate-pulse,
    .animate-shake,
    .toast-enter,
    .toast-leave,
    .progress-bar-animated,
    .pulse-alert::before {
        animation: none !important;
    }
}

/* ============ Responsive (Mobile) ============ */
@media (max-width: 767px) {
    .sidebar-mobile { transform: translateX(-100%); transition: transform 0.3s ease; }
    .sidebar-mobile.open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; padding: 1rem !important; }
    .loading-bar-desktop { left: 0 !important; }
}

/* ============ Print Styles ============ */
@media print {
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }
    .glass-card, .glass-panel, .glass {
        background: white !important;
        backdrop-filter: none !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    .glow, .glow-line, .glow-trail, .glow-primary,
    .glow-line-green, .glow-line-blue, .glow-amber, .glow-red {
        box-shadow: none !important;
    }
    aside,
    #login-overlay,
    #toast-container,
    .loading-bar-desktop,
    button,
    select,
    input,
    textarea,
    [x-show="loading"],
    .sidebar-mobile,
    .mobile-bottom-nav {
        display: none !important;
    }
    main {
        margin-left: 0 !important;
        padding: 1rem !important;
        position: static !important;
    }
    table {
        border-collapse: collapse;
        width: 100%;
    }
    th, td {
        border: 1px solid #ccc;
        padding: 4px 8px;
        color: black !important;
    }
    th {
        background: #f0f0f0 !important;
        font-weight: bold;
    }
    .rounded-2xl, .rounded-xl {
        page-break-inside: avoid;
    }
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    [class*="bg-surface"], [class*="bg-dark-"] {
        background: white !important;
    }
    .text-on-surface, .text-on-surface-variant,
    .text-white, .text-gray-100, .text-gray-200,
    .text-gray-300, .text-gray-400 {
        color: black !important;
    }
}

/* ============ Material Symbols ============ */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
