/* ============================================
   NEXUS - Global Styles
   ============================================ */

:root {
    --nexus-bg-dark: #0A0A0F;
    --nexus-bg: #0D0D14;
    --nexus-surface: #12121A;
    --nexus-surface-light: #1A1A24;
    --nexus-primary: #00D9A5;
    --nexus-secondary: #7B68EE;
    --nexus-text: #FFFFFF;
    --nexus-text-muted: #9CA3AF;
    --nexus-border: #2D2D3A;
    --nexus-divider: #1F1F2E;
}

/* Base */
html, body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--nexus-bg);
    color: var(--nexus-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--nexus-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--nexus-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3D3D4A;
}

/* Cards con glow sutil */
.mud-paper {
    border: 1px solid var(--nexus-divider) !important;
}

.mud-paper:hover {
    border-color: var(--nexus-border) !important;
}

/* Card stats con gradiente */
.nexus-stat-card {
    background: linear-gradient(135deg, var(--nexus-surface) 0%, var(--nexus-surface-light) 100%);
    border: 1px solid var(--nexus-divider);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
}

.nexus-stat-card:hover {
    border-color: var(--nexus-primary);
    box-shadow: 0 0 20px rgba(0, 217, 165, 0.1);
}

.nexus-stat-card.primary {
    border-left: 3px solid var(--nexus-primary);
}

.nexus-stat-card.secondary {
    border-left: 3px solid var(--nexus-secondary);
}

.nexus-stat-card.success {
    border-left: 3px solid #00D9A5;
}

.nexus-stat-card.error {
    border-left: 3px solid #FF6B6B;
}

/* Stat value grande */
.nexus-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--nexus-text);
}

.nexus-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--nexus-text-muted);
    margin-bottom: 8px;
}

.nexus-stat-sublabel {
    font-size: 0.8125rem;
    color: var(--nexus-primary);
    margin-top: 4px;
}

/* Table styling */
.mud-table {
    background: var(--nexus-surface) !important;
    border-radius: 12px !important;
    overflow: hidden;
}

.mud-table-head {
    background: var(--nexus-bg) !important;
}

.mud-table-row:hover {
    background: var(--nexus-surface-light) !important;
}

/* Chips de estado */
.nexus-chip-running {
    background: rgba(78, 205, 196, 0.15) !important;
    color: #4ECDC4 !important;
    border: 1px solid rgba(78, 205, 196, 0.3) !important;
}

.nexus-chip-completed {
    background: rgba(0, 217, 165, 0.15) !important;
    color: #00D9A5 !important;
    border: 1px solid rgba(0, 217, 165, 0.3) !important;
}

.nexus-chip-failed {
    background: rgba(255, 107, 107, 0.15) !important;
    color: #FF6B6B !important;
    border: 1px solid rgba(255, 107, 107, 0.3) !important;
}

.nexus-chip-pending {
    background: rgba(255, 179, 71, 0.15) !important;
    color: #FFB347 !important;
    border: 1px solid rgba(255, 179, 71, 0.3) !important;
}

/* Procedure badge */
.nexus-proc-badge {
    background: linear-gradient(135deg, var(--nexus-secondary) 0%, #6355CC 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Code blocks */
.nexus-code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.8125rem;
    background: var(--nexus-bg);
    border: 1px solid var(--nexus-divider);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

/* Glow effect para elementos importantes */
.nexus-glow {
    box-shadow: 0 0 20px rgba(0, 217, 165, 0.2);
}

.nexus-glow-secondary {
    box-shadow: 0 0 20px rgba(123, 104, 238, 0.2);
}

/* Animacion pulse para running tasks */
@keyframes nexus-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.nexus-pulse {
    animation: nexus-pulse 2s ease-in-out infinite;
}

/* Drawer hover colors */
.mud-nav-link:hover {
    background: var(--nexus-surface-light) !important;
}

.mud-nav-link.active {
    background: rgba(0, 217, 165, 0.1) !important;
    border-right: 2px solid var(--nexus-primary);
}

/* Dialog styling */
.mud-dialog {
    background: var(--nexus-surface) !important;
    border: 1px solid var(--nexus-divider) !important;
    border-radius: 16px !important;
}

/* Button variants */
.mud-button-filled.mud-button-primary {
    background: linear-gradient(135deg, var(--nexus-primary) 0%, #00B388 100%) !important;
}

.mud-button-outlined.mud-button-primary {
    border-color: var(--nexus-primary) !important;
    color: var(--nexus-primary) !important;
}

.mud-button-outlined.mud-button-primary:hover {
    background: rgba(0, 217, 165, 0.1) !important;
}

/* Error boundary */
.blazor-error-boundary {
    background: var(--nexus-surface);
    padding: 1rem;
    color: #FF6B6B;
    border: 1px solid #FF6B6B;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}
