/* DarkPentra Premium Enhancements */
/* Modern Skeleton Loaders, Micro-animations, and Polish */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Override default font */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Improved Card Hover Effects */
.card:hover {
    border-color: rgba(139,92,246,0.4) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 40px rgba(139,92,246,0.15) !important;
}

.stat-card:hover,
.agent-card:hover,
.signal-card:hover {
    border-color: rgba(139,92,246,0.3) !important;
    transform: translateY(-2px) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Skeleton Loader Base */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(30, 41, 59, 0.8) 0%,
        rgba(139, 92, 246, 0.15) 50%,
        rgba(30, 41, 59, 0.8) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton Variants */
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
    border-radius: 6px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: 16px;
}

.skeleton-row {
    height: 48px;
    margin-bottom: 8px;
    border-radius: 8px;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8B5CF6;
    border-radius: 50%;
    animation: spinner-rotate 0.6s linear infinite;
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* Loading States */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: 16px;
}

.loading-text {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Improved Button Animations */
button,
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

button:hover:not(:disabled),
.btn:hover:not(:disabled) {
    transform: translateY(-1px) !important;
}

button:active:not(:disabled),
.btn:active:not(:disabled) {
    transform: translateY(0) !important;
}

/* Pulse Animation for Live Data */
.live-indicator {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
}

.live-indicator::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: inherit;
    border-radius: 50%;
    opacity: 0.5;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Number Counter Animation */
@keyframes countup {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-count {
    animation: countup 0.3s ease-out;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

/* Improved Table Styles */
table tbody tr {
    transition: background-color 0.15s ease, transform 0.15s ease;
}

table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05) !important;
    transform: scale(1.01);
}

/* Sparkline Mini Charts */
.sparkline-container {
    width: 80px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}

.sparkline {
    width: 100%;
    height: 100%;
}

/* Improved Badge Styles */
.badge,
.card-badge {
    font-weight: 600 !important;
    padding: 4px 12px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
}

.badge-buy {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10B981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-sell {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #EF4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-neutral {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #F59E0B !important;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Improved Progress Bars */
.progress-bar {
    height: 6px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6 0%, #06B6D4 100%);
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Tooltip Improvements */
.tooltip {
    position: absolute;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }

/* Improved Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* Improved Input Focus States */
input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--purple) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1) !important;
}

/* Monospace for Numbers */
.number,
.price,
.percentage,
.stat h3,
.stat-value {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
    font-family: 'Inter', -apple-system, system-ui, sans-serif !important;
}

/* Improved Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.card-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .icon {
    font-size: 18px;
    opacity: 0.8;
}

/* Improved Agent Cards */
.agent-card {
    position: relative;
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.agent-card:hover::before {
    transform: scaleX(1);
}

/* Status Indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-online { background: #10B981; }
.status-offline { background: #64748B; }
.status-warning { background: #F59E0B; }
.status-error { background: #EF4444; }

/* Improved Sidebar Hover */
.nav-item {
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-primary);
    transition: height 0.2s ease;
}

.nav-item.active::before,
.nav-item:hover::before {
    height: 60%;
}

/* Chart Container Improvements */
.chart-container {
    position: relative;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-glass);
}

.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state-text {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* Success/Error Animations */
@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    100% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.success-animation {
    animation: successPulse 0.6s ease-out;
}

.error-animation {
    animation: errorShake 0.4s ease-out;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .card {
        padding: 16px !important;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .features-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Dark Mode Shadows Enhancement */
.card,
.stat-card,
.agent-card {
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 2px 4px -1px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(139, 92, 246, 0.05) !important;
}

/* Gradient Text Utility */
.text-gradient {
    background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smooth Page Transitions */
.page-transition {
    animation: pageEnter 0.3s ease-out;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
