/* ========================= Nexus Design System Enhancements ========================= */

/* Modern Animations */
@keyframes nexus-glow {

    0%,
    100% {
        box-shadow: var(--shadow-lg), 0 0 20px hsl(var(--accent) / 0.2);
    }

    50% {
        box-shadow: var(--shadow-xl), 0 0 30px hsl(var(--accent) / 0.4);
    }
}

@keyframes nexus-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes nexus-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes nexus-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Enhanced Dashboard Cards */
.nexus-dashboard-card {
    background: var(--gradient-card);
    border: 1px solid hsl(var(--gray-800));
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: nexus-slide-in 0.6s ease-out;
}

.nexus-dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-button);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nexus-dashboard-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: hsl(var(--accent) / 0.4);
}

.nexus-dashboard-card:hover::before {
    opacity: 1;
}

/* Modern Statistics Cards */
.nexus-stat-card {
    background: var(--gradient-card);
    border: 1px solid hsl(var(--gray-800));
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nexus-stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, hsl(var(--accent) / 0.1), transparent);
    transition: transform 0.6s ease;
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
}

.nexus-stat-card:hover::after {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

.nexus-stat-value {
    font-family: var(--accent-font);
    font-size: 2.5rem;
    font-weight: 700;
    color: hsl(var(--accent));
    margin-bottom: 8px;
    text-shadow: 0 0 20px hsl(var(--accent) / 0.3);
}

.nexus-stat-label {
    font-family: var(--primary-font);
    font-size: 14px;
    color: hsl(var(--text-secondary));
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Enhanced Tables */
.nexus-table {
    width: 100%;
    background: var(--gradient-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid hsl(var(--gray-800));
}

.nexus-table thead {
    background: var(--gradient-charcoal);
}

.nexus-table th {
    padding: 16px 20px;
    font-family: var(--accent-font);
    font-weight: 600;
    color: hsl(var(--text-primary));
    border-bottom: 1px solid hsl(var(--gray-800));
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.1em;
}

.nexus-table td {
    padding: 16px 20px;
    color: hsl(var(--text-secondary));
    border-bottom: 1px solid hsl(var(--gray-800) / 0.5);
    transition: background-color 0.2s ease;
}

.nexus-table tbody tr:hover td {
    background: hsl(var(--slate) / 0.3);
}

/* Modern Progress Bars */
.nexus-progress {
    width: 100%;
    height: 8px;
    background: hsl(var(--gray-800));
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.nexus-progress-bar {
    height: 100%;
    background: var(--gradient-button);
    border-radius: 4px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.nexus-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, hsl(var(--white) / 0.3), transparent);
    animation: nexus-shimmer 2s infinite;
}

@keyframes nexus-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Enhanced Modals */
.nexus-modal {
    background: var(--gradient-card);
    border: 1px solid hsl(var(--gray-800));
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
    animation: nexus-slide-in 0.3s ease-out;
}

.nexus-modal-header {
    padding: 24px 24px 0;
    border-bottom: 1px solid hsl(var(--gray-800));
}

.nexus-modal-title {
    font-family: var(--accent-font);
    font-size: 20px;
    font-weight: 600;
    color: hsl(var(--text-primary));
    margin: 0;
}

.nexus-modal-body {
    padding: 24px;
}

/* Enhanced Alerts */
.nexus-alert {
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    animation: nexus-slide-in 0.4s ease-out;
}

.nexus-alert--success {
    background: hsl(var(--accent) / 0.1);
    border-left-color: hsl(var(--accent));
    color: hsl(var(--accent));
}

.nexus-alert--warning {
    background: hsl(45 100% 50% / 0.1);
    border-left-color: hsl(45 100% 50%);
    color: hsl(45 100% 70%);
}

.nexus-alert--error {
    background: hsl(0 100% 50% / 0.1);
    border-left-color: hsl(0 100% 50%);
    color: hsl(0 100% 70%);
}

.nexus-alert--info {
    background: hsl(210 100% 50% / 0.1);
    border-left-color: hsl(210 100% 50%);
    color: hsl(210 100% 70%);
}

/* Enhanced Badges */
.nexus-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--primary-font);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
}

.nexus-badge--success {
    background: var(--gradient-button);
    color: hsl(var(--obsidian));
}

.nexus-badge--warning {
    background: linear-gradient(135deg, hsl(45 100% 50%) 0%, hsl(45 100% 40%) 100%);
    color: hsl(var(--obsidian));
}

.nexus-badge--error {
    background: linear-gradient(135deg, hsl(0 100% 60%) 0%, hsl(0 100% 50%) 100%);
    color: hsl(var(--white));
}

.nexus-badge--info {
    background: linear-gradient(135deg, hsl(210 100% 60%) 0%, hsl(210 100% 50%) 100%);
    color: hsl(var(--white));
}

/* Loading Animations */
.nexus-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid hsl(var(--gray-700));
    border-top: 2px solid hsl(var(--accent));
    border-radius: 50%;
    animation: nexus-spin 1s linear infinite;
}

@keyframes nexus-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .nexus-dashboard-card {
        padding: 16px;
        border-radius: 12px;
    }

    .nexus-stat-value {
        font-size: 2rem;
    }

    .nexus-table th,
    .nexus-table td {
        padding: 12px 16px;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
.nexus-btn:focus-visible,
.nexus-input:focus-visible {
    outline: 2px solid hsl(var(--accent));
    outline-offset: 2px;
}

/* Print Styles */
@media print {

    .nexus-sidebar,
    .nexus-btn,
    .sidebar-overlay {
        display: none !important;
    }

    .nexus-dashboard-card,
    .nexus-table {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* === Dashboard Components === */
.nexus-dashboard-card {
    background: var(--gradient-obsidian);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid hsl(var(--charcoal));
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nexus-dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.nexus-dashboard-card__title {
    color: hsl(var(--accent));
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nexus-dashboard-card__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.nexus-dashboard-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.nexus-dashboard-card__icon.nexus-icon--primary {
    background: var(--gradient-button);
    color: hsl(var(--obsidian));
}

.nexus-dashboard-card__icon.nexus-icon--secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nexus-dashboard-card__header-content h6 {
    margin: 0;
    color: hsl(var(--muted));
    font-size: 0.9rem;
}

.nexus-dashboard-card__amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: hsl(var(--accent));
}

.nexus-dashboard-card__investment-title {
    color: hsl(var(--muted));
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.nexus-dashboard-card__investment-number {
    font-size: 2rem;
    font-weight: 700;
    color: hsl(var(--accent));
    margin: 0;
}

.nexus-dashboard-card__stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nexus-stat-item {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid hsl(var(--charcoal));
}

.nexus-stat-item__label {
    display: block;
    color: hsl(var(--muted));
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.nexus-stat-item__value {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0;
}

/* === Wallet Cards === */
.nexus-wallet-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid hsl(var(--charcoal));
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.nexus-wallet-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.nexus-wallet-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.nexus-wallet-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient-button);
    color: hsl(var(--obsidian));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nexus-wallet-card--secondary .nexus-wallet-card__icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nexus-wallet-card__title {
    color: hsl(var(--muted));
    font-size: 0.85rem;
    margin: 0;
    flex: 1;
}

.nexus-wallet-card__amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: hsl(var(--accent));
    margin: 0 0 0.5rem 0;
}

.nexus-wallet-card__percentage {
    color: hsl(var(--accent));
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

/* === Table Enhancements === */
.nexus-table-section {
    background: var(--gradient-obsidian);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid hsl(var(--charcoal));
}

.nexus-section-title {
    color: hsl(var(--accent));
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nexus-table-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid hsl(var(--charcoal));
}

.nexus-table {
    width: 100%;
    margin: 0;
    background: transparent;
}

.nexus-table th {
    background: rgba(255, 255, 255, 0.05);
    color: hsl(var(--accent));
    font-weight: 600;
    padding: 1rem;
    border-bottom: 1px solid hsl(var(--charcoal));
    font-size: 0.9rem;
}

.nexus-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: hsl(var(--foreground));
}

.nexus-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.nexus-amount {
    font-weight: 600;
    font-family: var(--accent-font);
}

.nexus-amount--positive {
    color: hsl(var(--accent));
}

.nexus-amount--negative {
    color: #ff6b6b;
}

.nexus-empty-state {
    padding: 3rem 1rem;
}

.nexus-empty-state__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.nexus-empty-state__icon {
    font-size: 3rem;
    color: hsl(var(--muted));
    opacity: 0.5;
}

.nexus-empty-state__message {
    color: hsl(var(--muted));
    font-size: 1rem;
    margin: 0;
}

/* === Links === */
.nexus-link {
    color: hsl(var(--accent));
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nexus-link:hover {
    color: hsl(var(--accent));
    text-decoration: underline;
    text-shadow: 0 0 8px hsla(var(--accent), 0.3);
}

/* === Text Utilities === */
.nexus-text--primary {
    color: hsl(var(--accent)) !important;
}

.nexus-text--success {
    color: hsl(var(--accent)) !important;
}

.nexus-text--warning {
    color: #ffd93d !important;
}

.nexus-text--danger {
    color: #ff6b6b !important;
}

.nexus-text--info {
    color: #74c0fc !important;
}

/* === Icon Utilities === */
.nexus-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nexus-icon--success {
    color: hsl(var(--accent));
}

.nexus-icon--warning {
    color: #ffd93d;
}

.nexus-icon--danger {
    color: #ff6b6b;
}

.nexus-icon--info {
    color: #74c0fc;
}

/* === Animations === */
.nexus-blink {
    animation: nexus-blink 1.5s ease-in-out infinite;
}

@keyframes nexus-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.nexus-pulse {
    animation: nexus-pulse 2s ease-in-out infinite;
}

@keyframes nexus-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* === Badge Enhancements === */
.nexus-badge--outline {
    background: transparent;
    border: 1px solid hsl(var(--accent));
    color: hsl(var(--accent));
}

.nexus-badge--outline:hover {
    background: hsl(var(--accent));
    color: hsl(var(--obsidian));
}

/* === Loading Sizes === */
.nexus-loading--lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* === Responsive Enhancements === */
@media (max-width: 768px) {
    .nexus-dashboard-card__stats {
        flex-direction: row;
        gap: 0.5rem;
    }

    .nexus-stat-item {
        min-width: auto;
    }

    .nexus-wallet-card {
        margin-bottom: 1rem;
    }

    .nexus-table-container {
        overflow-x: auto;
    }

    .nexus-section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .nexus-dashboard-card {
        padding: 1rem;
    }

    .nexus-table-section {
        padding: 1rem;
    }
}