/* Advanced Trading Platform Styles */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
}

/* Status Indicators */
.status-connected {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.status-partial {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.status-disconnected {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Price Display */
.price-up {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
}

.price-down {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
}

/* Technical Indicators Grid */
.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.indicator-item {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    border: 1px solid #6b7280;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.indicator-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.indicator-item.overbought {
    border-color: #ef4444;
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

.indicator-item.oversold {
    border-color: #10b981;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
}

.indicator-item.bullish {
    border-color: #10b981;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
}

.indicator-item.bearish {
    border-color: #ef4444;
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

.indicator-item.strong-trend {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 100%);
}

.indicator-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #d1d5db;
}

.indicator-value {
    font-weight: 700;
    font-size: 1rem;
    color: #f3f4f6;
}

/* Trading Signals */
.signal-item {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    border: 1px solid #6b7280;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.signal-item:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.signal-bullish {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
}

.signal-bearish {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

.signal-neutral {
    border-left: 4px solid #6b7280;
}

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

.signal-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #f3f4f6;
}

.signal-strength {
    font-family: monospace;
    font-size: 0.8rem;
    color: #a78bfa;
    letter-spacing: 1px;
}

.signal-details {
    display: flex;
    justify-between;
    font-size: 0.8rem;
    color: #d1d5db;
}

.signal-source {
    background: #4b5563;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.no-signals {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
    font-style: italic;
}

/* AI Analysis */
.ai-analysis-content {
    padding: 0.5rem 0;
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #4b5563;
}

.ai-confidence {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.ai-recommendation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border-radius: 0.5rem;
}

.recommendation-value {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 1rem;
}

.recommendation-value.buy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.recommendation-value.sell {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.recommendation-value.wait {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.ai-reasoning {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(139, 92, 246, 0.1);
    border-left: 3px solid #8b5cf6;
    border-radius: 0.375rem;
}

.ai-components {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.component {
    display: flex;
    justify-between;
    align-items: center;
    font-size: 0.85rem;
    padding: 0.5rem;
    background: rgba(75, 85, 99, 0.3);
    border-radius: 0.25rem;
}

/* Final Recommendation */
.final-recommendation {
    padding: 1rem;
    border-radius: 0.75rem;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    transition: all 0.3s ease;
}

.final-recommendation.buy {
    border-color: #10b981;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.final-recommendation.sell {
    border-color: #ef4444;
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.final-recommendation.wait {
    border-color: #6b7280;
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
}

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

.confidence-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.recommendation-action {
    display: flex;
    justify-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
}

.action-value {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
}

.recommendation-reasoning {
    margin-bottom: 1rem;
    font-style: italic;
    color: #d1d5db;
}

.recommendation-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.detail {
    display: flex;
    justify-between;
    align-items: center;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail:last-child {
    border-bottom: none;
}

/* Simple Chart */
.simple-chart {
    display: flex;
    align-items: end;
    height: 200px;
    padding: 1rem;
    gap: 2px;
}

.chart-bar {
    background: linear-gradient(to top, #3b82f6, #60a5fa);
    width: 8px;
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.chart-bar:hover {
    background: linear-gradient(to top, #1d4ed8, #3b82f6);
    transform: scaleY(1.1);
}

/* Error Notifications */
.error-notification {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #4b5563;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }
    
    .indicators-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-components {
        grid-template-columns: 1fr;
    }
    
    .signal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .recommendation-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Dark Mode Enhancements */
.bg-gray-800 {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border: 1px solid #4b5563;
}

.bg-gray-900 {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

/* Interactive Elements */
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

select:focus, input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Animation Utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Risk Assessment Styles */
.risk-overview {
    margin-bottom: 1rem;
}

.risk-level {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.risk-level.risk-low {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border: 1px solid #10b981;
}

.risk-level.risk-medium {
    background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
    border: 1px solid #f59e0b;
}

.risk-level.risk-high {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border: 1px solid #ef4444;
}

.risk-warnings {
    margin-bottom: 1rem;
}

.risk-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

.risk-warning.risk-high {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.risk-warning.risk-medium {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.risk-factors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.risk-factor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(75, 85, 99, 0.3);
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

/* Chart Container Styles */
.custom-chart-container {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    border-radius: 0.75rem;
    padding: 1rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #4b5563;
}

.chart-info {
    font-size: 0.85rem;
    color: #9ca3af;
}

.chart-grid {
    position: relative;
    margin-bottom: 1rem;
}

.chart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.price-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#chart-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: #f3f4f6;
}

/* Improved Bollinger Bands Display */
.indicator-item[title] {
    cursor: help;
}

.indicator-item .indicator-value {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}