/* Financial Sentiment Engine - Dashboard Styles */
/* Modern dark theme with glassmorphism effects */

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 26, 0.8);
    --bg-card-hover: rgba(25, 25, 35, 0.9);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    
    --bullish: #10b981;
    --bearish: #ef4444;
    --neutral: #f59e0b;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.5);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-bullish: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-bearish: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Main */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl);
}

/* Asset Selector */
.asset-selector {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.asset-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.asset-btn:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.asset-btn.active {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.asset-icon {
    font-size: 2rem;
}

.asset-name {
    font-weight: 600;
    color: var(--text-primary);
}

.asset-ticker {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-badge {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-secondary);
    border-radius: var(--radius-sm);
}

.card-body {
    padding: var(--space-lg);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* Price Card */
.price-display {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
}

.price-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.price-change {
    font-size: 1.1rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.price-change.positive {
    background: rgba(16, 185, 129, 0.15);
    color: var(--bullish);
}

.price-change.negative {
    background: rgba(239, 68, 68, 0.15);
    color: var(--bearish);
}

/* Prediction Card */
.prediction-display {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.prediction-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.prediction-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prediction-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.prediction-value.bullish {
    color: var(--bullish);
}

.prediction-value.bearish {
    color: var(--bearish);
}

.prediction-value.neutral {
    color: var(--neutral);
}

.confidence-meter {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.confidence-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.confidence-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width var(--transition-slow);
}

.confidence-value {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* Sentiment Card */
.sentiment-gauge {
    text-align: center;
}

.sentiment-dial {
    width: 120px;
    height: 60px;
    margin: 0 auto var(--space-md);
    background: linear-gradient(to right, var(--bearish), var(--neutral), var(--bullish));
    border-radius: 60px 60px 0 0;
    position: relative;
    overflow: hidden;
}

.dial-indicator {
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 4px;
    height: 35px;
    background: white;
    border-radius: 2px;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
    transition: transform var(--transition-slow);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.sentiment-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Narrative Card */
.narrative-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Chart Section */
.chart-section {
    margin-bottom: var(--space-xl);
}

.card-chart {
    min-height: 400px;
}

.chart-controls {
    display: flex;
    gap: var(--space-sm);
}

.chart-range-btn {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-range-btn:hover, .chart-range-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* Analysis Section */
.analysis-section {
    margin-bottom: var(--space-xl);
}

.reasoning-content {
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.8;
    color: var(--text-secondary);
}

.reasoning-content::-webkit-scrollbar {
    width: 6px;
}

.reasoning-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.reasoning-content::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

/* News Section */
.news-section {
    margin-bottom: var(--space-xl);
}

.news-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.news-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.news-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.news-sentiment {
    width: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.news-sentiment.positive { background: var(--bullish); }
.news-sentiment.negative { background: var(--bearish); }
.news-sentiment.neutral { background: var(--neutral); }

.news-content {
    flex: 1;
}

.news-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: var(--space-xs);
}

.news-title a {
    color: inherit;
    text-decoration: none;
}

.news-title a:hover {
    color: var(--accent-secondary);
}

.news-meta {
    display: flex;
    gap: var(--space-md);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Accuracy Section */
.accuracy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    text-align: center;
}

.accuracy-stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.accuracy-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.accuracy-value {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--space-xl);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.disclaimer {
    margin-top: var(--space-sm);
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: var(--space-md);
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .asset-selector {
        flex-direction: column;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .accuracy-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}
