/* Professional Trading Chart Styles */

.trading-chart-container {
    background: #1a1d29;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    width: 100%;
    min-height: 500px;
}

/* Chart Header */
.chart-header {
    padding: 20px 24px;
    background: #0f1118;
    border-bottom: 1px solid rgba(42, 46, 57, 0.5);
}

.symbol-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.symbol-pair {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crypto-icons {
    display: flex;
    gap: -8px;
}

.crypto-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    border: 2px solid #1a1d29;
}

.crypto-icon.bitcoin {
    background: linear-gradient(135deg, #f7931a, #ffb84d);
    color: white;
}

.crypto-icon.tether {
    background: linear-gradient(135deg, #26a17b, #50d0a4);
    color: white;
    margin-left: -8px;
}

.symbol-text {
    font-size: 16px;
    font-weight: 500;
    color: #d1d4dc;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.price-info {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.price-currency {
    font-size: 14px;
    font-weight: 500;
    color: #8a919e;
    text-transform: uppercase;
    margin-left: -12px;
}

.price-change {
    font-size: 20px;
    font-weight: 600;
}

.price-change.positive {
    color: #26a69a;
}

.price-change.negative {
    color: #ef5350;
}

.price-change-percent {
    font-size: 20px;
    font-weight: 600;
}

.price-change-percent.positive {
    color: #26a69a;
}

.price-change-percent.negative {
    color: #ef5350;
}

.period-label {
    font-size: 14px;
    color: #8a919e;
    font-weight: 400;
}

/* Time Intervals */
.time-intervals {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    background: #0f1118;
    border-bottom: 1px solid rgba(42, 46, 57, 0.5);
}

.interval-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #8a919e;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.interval-btn:hover {
    background: rgba(79, 70, 229, 0.1);
    color: #d1d4dc;
}

.interval-btn.active {
    background: rgba(79, 70, 229, 0.15);
    border-color: #4f46e5;
    color: #4f46e5;
}

/* Chart Container */
.chart-main {
    height: 500px;
    min-height: 500px;
    background: #1a1d29;
    position: relative;
}

#chart-container, .chart-main {
    width: 100%;
    height: 600px;
    min-height: 600px;
    display: block;
    position: relative;
}

/* Chart Error State */
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ef5350;
    font-size: 14px;
    font-weight: 500;
}

/* Loading State */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
    color: #8a919e;
}

.chart-loading::before {
    content: '';
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border: 3px solid #2a2e39;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chart-header {
        padding: 16px 20px;
    }
    
    .current-price {
        font-size: 24px;
    }
    
    .price-change,
    .price-change-percent {
        font-size: 16px;
    }
    
    .time-intervals {
        padding: 10px 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .interval-btn {
        padding: 6px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .chart-main {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .symbol-info {
        gap: 8px;
    }
    
    .crypto-icon {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    
    .symbol-text {
        font-size: 14px;
    }
    
    .current-price {
        font-size: 20px;
    }
    
    .price-change,
    .price-change-percent {
        font-size: 14px;
    }
    
    .chart-main {
        height: 350px;
    }
}

/* Dark Theme Integration */
.card-bs .trading-chart-container {
    background: var(--bs-card-bg, #1a1d29);
}

.card-bs .chart-header,
.card-bs .time-intervals {
    background: rgba(0, 0, 0, 0.3);
}

/* Ensure chart container is properly sized */
#trading-chart-container {
    width: 100%;
    min-height: 600px;
}

/* Custom scrollbar for time intervals on mobile */
.time-intervals::-webkit-scrollbar {
    height: 4px;
}

.time-intervals::-webkit-scrollbar-track {
    background: rgba(42, 46, 57, 0.3);
    border-radius: 2px;
}

.time-intervals::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 2px;
}

.time-intervals::-webkit-scrollbar-thumb:hover {
    background: #5b52f5;
}

/* Chart tooltip styles (if needed) */
.chart-tooltip {
    position: absolute;
    display: none;
    padding: 8px 12px;
    background: rgba(15, 17, 24, 0.95);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 6px;
    color: #d1d4dc;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

.chart-tooltip.visible {
    display: block;
}

/* Price line indicator */
.price-line-label {
    background: #3a7bd5 !important;
    color: white !important;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
}