/* Modern Enhancements CSS */

/* Mini Charts */
.mini-chart {
    margin-top: 8px;
    padding: 4px 0;
}

.price-chart {
    width: 60px;
    height: 30px;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.price-chart:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

/* Advanced Stats */
.advanced-stats {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 255, 255, 0.1);
}

.stat-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.stat-item.advanced {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(30, 35, 40, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stat-item.advanced:hover {
    background: rgba(40, 45, 50, 0.8);
    border-color: rgba(0, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 255, 255, 0.15);
}

.stat-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    flex-shrink: 0;
    color: var(--primary-color, #00FFFF);
    transition: all 0.3s ease;
}

.stat-icon svg {
    width: 18px;
    height: 18px;
    color: inherit;
}

.stat-item.advanced:hover .stat-icon {
    background: rgba(0, 255, 255, 0.2);
    border-color: rgba(0, 255, 255, 0.4);
    transform: scale(1.05);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-content .stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
}

.stat-content .stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.stat-content .stat-change {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.stat-updating {
    animation: statUpdate 0.4s ease;
}

@keyframes statUpdate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); background-color: rgba(0, 255, 255, 0.2); }
}

/* Crypto Tooltips - Disabled */

/* Crypto Item Selection */
.crypto-item.selected {
    background: rgba(0, 255, 255, 0.15);
    border-color: rgba(0, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 255, 255, 0.3);
}

.selection-feedback {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #00FF88, #00FFFF);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    animation: selectionPop 0.3s ease;
    z-index: 10;
}

.selection-feedback.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

@keyframes selectionPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Volume Indicators */
.volume-indicator {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.volume-fill {
    height: 100%;
    background: linear-gradient(90deg, #00FFFF, #9333EA);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.volume-text {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    min-width: 30px;
}

/* Trending Section */
.trending-section {
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 40px 24px 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

.trending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.trending-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.trending-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #00FF88;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(30, 35, 40, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.trending-item:hover {
    background: rgba(40, 45, 50, 0.7);
    border-color: rgba(0, 255, 255, 0.3);
    transform: translateX(4px);
}

.trending-rank {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    min-width: 20px;
}

.trending-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 8px;
}

.trending-symbol {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    flex: 1;
}

.trending-change {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

/* Stat Modal */
.stat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.stat-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.stat-modal-content {
    position: relative;
    background: rgba(15, 20, 25, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
    animation: modalSlideIn 0.4s ease;
}

.stat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.stat-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.stat-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.stat-modal-body {
    padding: 24px;
}

.stat-detail-chart {
    margin-bottom: 20px;
    text-align: center;
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(30, 35, 40, 0.5);
    border-radius: 8px;
    font-size: 14px;
}

.detail-row span:first-child {
    color: rgba(255, 255, 255, 0.7);
}

.detail-row span:last-child {
    color: #ffffff;
    font-weight: 600;
}

/* Chart Modal */
.chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chart-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.chart-modal-content {
    position: relative;
    background: rgba(15, 20, 25, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 20px;
    padding: 0;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
    animation: modalSlideIn 0.4s ease;
}

.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.chart-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.chart-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.chart-modal-body {
    padding: 24px;
    text-align: center;
}

.chart-controls {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.chart-timeframe {
    padding: 8px 16px;
    background: rgba(30, 35, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-timeframe:hover,
.chart-timeframe.active {
    background: rgba(0, 255, 255, 0.2);
    border-color: rgba(0, 255, 255, 0.4);
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .trending-section {
        margin: 20px 12px 10px;
        padding: 16px 18px;
    }
    
    .trending-header h3 {
        font-size: 16px;
    }
    
    .trending-item {
        padding: 8px 12px;
    }
    
    .stat-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .crypto-tooltip {
        min-width: 200px;
        padding: 12px;
    }
    
    .tooltip-actions {
        flex-direction: column;
    }
    
    .stat-modal-content,
    .chart-modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .chart-modal-body canvas {
        width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    .mini-chart {
        display: none; /* Hide charts on very small screens */
    }
    
    .volume-indicator {
        margin-top: 4px;
    }
    
    .volume-text {
        font-size: 9px;
    }
    
    .trending-list {
        gap: 6px;
    }
    
    .trending-item {
        padding: 6px 10px;
    }
    
    .trending-icon {
        width: 18px;
        height: 18px;
    }
    
    .trending-symbol {
        font-size: 13px;
    }
    
    .trending-change {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* Animation Keyframes */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .crypto-tooltip,
    .stat-modal-content,
    .chart-modal-content,
    .selection-feedback {
        animation: none !important;
        transition: none !important;
    }
    
    .pulse-dot {
        animation: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .crypto-tooltip,
    .stat-modal-content,
    .chart-modal-content {
        border: 2px solid #ffffff;
    }
    
    .trending-item,
    .stat-item.advanced {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
}