/* Advanced Finance Dashboard - Professional Grade Styling */

/* Dashboard Layout */
.finance-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* Live Market Overview */
.market-overview {
    background: linear-gradient(135deg, var(--entry) 0%, var(--theme) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.market-overview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(74, 144, 226, 0.05) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

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

.market-overview h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

/* Crypto Ticker */
.crypto-ticker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
    padding: 16px;
    background: var(--entry);
    border: 1px solid var(--border);
    border-radius: 16px;
    position: relative;
    z-index: 1;
}

.ticker-item {
    background: var(--theme);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ticker-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f7931a, #627eea, #f3ba2f);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ticker-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.ticker-item:hover::before {
    opacity: 1;
}

.crypto-number {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.crypto-symbol {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--secondary);
    min-width: 70px;
}

.crypto-price {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary);
    flex: 1;
    text-align: center;
}

.crypto-change {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 70px;
    text-align: center;
}

.crypto-change.positive {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.crypto-change.negative {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--entry);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary)20, transparent);
    opacity: 0.1;
    transform: translate(30px, -30px);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-content h3 {
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.stat-change.positive {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.stat-change.negative {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Main Sections */
.finance-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.section-card {
    background: var(--entry);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, transparent, var(--primary)40, transparent);
    border-radius: 20px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.section-card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-header h3 {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-icon {
    font-size: 1.5rem;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.update-indicator {
    color: var(--tertiary);
    font-size: 0.8rem;
}

/* News Preview */
.news-preview {
    margin: 1.5rem 0;
    min-height: 120px;
}

.news-item-preview {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.news-item-preview:last-child {
    border-bottom: none;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.news-source {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
}

.news-time {
    color: var(--tertiary);
    font-size: 0.75rem;
}

.news-title-preview {
    color: var(--secondary);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
}

/* Trade Preview */
.trade-preview {
    margin: 1.5rem 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.preview-charts {
    flex: 1;
}

.preview-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--theme);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.preview-stat span:first-child {
    color: var(--secondary);
    font-size: 0.85rem;
}

.preview-stat span:last-child {
    font-weight: 600;
}

/* Crypto Preview */
.crypto-preview {
    margin: 1.5rem 0;
}

.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: var(--theme);
}

.btn-primary:hover {
    background: var(--hljs-bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.btn-secondary {
    background: var(--theme);
    color: var(--primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--entry);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Data Sources */
.data-sources {
    background: var(--entry);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    margin-top: 3rem;
}

.data-sources h2 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--theme);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.source-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.source-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.source-info h4 {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.source-info p {
    color: var(--secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.source-update {
    color: var(--tertiary);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--theme) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    padding: 1rem;
    color: var(--tertiary);
    text-align: center;
}

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

/* Finance Page Styles */
.finance-card {
    background: var(--entry);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.finance-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.finance-card h3 {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.finance-card p {
    color: var(--secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .finance-dashboard {
        padding: 0.5rem;
    }
    
    .market-overview, .section-card, .stat-card {
        padding: 1.5rem;
    }
    
    .crypto-ticker {
        justify-content: center;
    }
    
    .finance-sections {
        grid-template-columns: 1fr;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .trade-preview {
        flex-direction: column;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .sources-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
    .ticker-item::before {
        background: linear-gradient(90deg, #ff9500, #4a90e2, #f4d03f);
    }
    
    .section-card::before {
        background: linear-gradient(135deg, transparent, rgba(74, 144, 226, 0.3), transparent);
    }
}