/* Modern Charts CSS - Dark Theme with Orange Accent */

/* Container Styles */
.modern-chart-container {
    background: linear-gradient(135deg, #1a1d29 0%, #252935 100%);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 107, 53, 0.1);
    margin-bottom: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.modern-chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.modern-chart-title {
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modern-chart-title i {
    color: #667eea;
    font-size: 1.25rem;
}

/* Chart Wrapper */
.chart-wrapper-modern {
    position: relative;
    display: flex;
    align-items: stretch;
    margin-bottom: 20px;
}

/* Scale on left */
.chart-scale-modern {
    width: 35px;
    height: 280px;
    position: relative;
    margin-right: 5px;
}

.scale-mark {
    position: absolute;
    right: 0;
    font-size: 11px;
    color: #6b7280;
    line-height: 1;
    transform: translateY(50%);
}

/* 24 Hour Chart */
.chart-24h-modern {
    flex: 1;
    display: flex;
    align-items: flex-end;
    height: 280px;
    gap: 0;
    padding: 0 8px 10px 8px;
    position: relative;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 55px,
            rgba(255, 255, 255, 0.05) 55px,
            rgba(255, 255, 255, 0.05) 56px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent calc(100% / 24 - 0.5px),
            rgba(255, 255, 255, 0.03) calc(100% / 24 - 0.5px),
            rgba(255, 255, 255, 0.03) calc(100% / 24)
        );
}

.chart-bar-group-modern {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    min-width: 0;
    padding: 0 1px;
}

.chart-bar-modern {
    width: 100%;
    background: #667eea;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 4px;
}

.chart-bar-max-modern {
    display: none; /* Hide max bars for cleaner look */
}

.chart-bar-group-modern:hover .chart-bar-modern {
    background: #764ba2;
}

/* Chart Labels */
.chart-label-modern {
    color: #6b7280;
    font-size: 9px;
    text-align: center;
    margin-top: 4px;
}

/* Tooltip */
.chart-tooltip-modern {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(66, 66, 66, 0.98);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 1000;
    min-width: 100px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.3;
    text-align: center;
}

.chart-bar-group-modern:hover .chart-tooltip-modern {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.chart-tooltip-time {
    font-size: 0.75rem;
    color: #fff;
    font-weight: 600;
    margin-bottom: 4px;
}

.chart-tooltip-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
}

.chart-tooltip-label {
    color: #ccc;
    font-size: 0.75rem;
}

/* 7 Day Horizontal Bar Chart */
.chart-7d-modern {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 12px;
}

.chart-day-row-modern {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chart-day-label-modern {
    width: 80px;
    color: #e5e7eb;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: right;
}

.chart-day-bars-modern {
    flex: 1;
    position: relative;
    height: 42px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    overflow: hidden;
}

.chart-day-bar-modern {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chart-day-bar-max-modern {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-radius: 6px;
}

.chart-day-value-modern {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.chart-day-row-modern:hover .chart-day-bar-modern {
    background: linear-gradient(90deg, #764ba2 0%, #8b5cf6 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Legend */
.chart-legend-modern {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-legend-item-modern {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-legend-color-modern {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chart-legend-color-modern.avg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chart-legend-color-modern.max {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.chart-legend-text-modern {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .chart-24h-modern {
        height: 240px;
    }
    
    .chart-bar-group-modern:nth-child(even) .chart-label-modern {
        display: none;
    }
}

@media (max-width: 768px) {
    .modern-chart-container {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .modern-chart-title {
        font-size: 1rem;
    }
    
    .chart-24h-modern {
        height: 200px;
        gap: 2px;
        padding: 0 4px 8px 4px;
    }
    
    /* Labels removed */
    
    .chart-day-label-modern {
        width: 60px;
        font-size: 0.75rem;
    }
    
    .chart-day-bars-modern {
        height: 28px;
    }
    
    .chart-day-value-modern {
        font-size: 0.75rem;
    }
    
    .chart-legend-modern {
        gap: 16px;
        flex-wrap: wrap;
    }
    
    .chart-legend-text-modern {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .modern-chart-container {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .modern-chart-title {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }
    
    .chart-24h-modern {
        height: 160px;
        gap: 1px;
        overflow-x: auto;
        min-width: 400px;
        padding: 0 4px 8px 4px;
    }
    
    /* Scrollbar styling for mobile */
    .chart-24h-modern::-webkit-scrollbar {
        height: 4px;
    }
    
    .chart-24h-modern::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 2px;
    }
    
    .chart-24h-modern::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 2px;
    }
    
    /* Labels removed */
    
    .chart-day-row-modern {
        gap: 8px;
    }
    
    .chart-day-label-modern {
        width: 50px;
        font-size: 0.7rem;
    }
    
    .chart-day-bars-modern {
        height: 24px;
    }
    
    .chart-day-value-modern {
        font-size: 0.7rem;
        padding-right: 8px;
    }
    
    .chart-tooltip-modern {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
    
    .chart-legend-modern {
        gap: 12px;
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .chart-legend-color-modern {
        width: 12px;
        height: 12px;
    }
}

/* 30 Day Chart */
.chart-30d-modern {
    display: flex;
    align-items: flex-end;
    gap: 1px;
}

.chart-30d-modern .chart-bar-group-modern {
    position: relative;
}

.chart-30d-modern .chart-bar-modern,
.chart-30d-modern .chart-bar-max-modern {
    border-radius: 2px 2px 0 0;
}

.chart-30d-modern .chart-bar-modern {
    min-height: 3px;
}

.chart-30d-modern .chart-label-modern {
    font-size: 0.6rem;
}

/* Animation Effects */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-bar-modern {
    animation: slideInUp 0.6s ease-out backwards;
}

.chart-bar-group-modern:nth-child(1) .chart-bar-modern { animation-delay: 0.05s; }
.chart-bar-group-modern:nth-child(2) .chart-bar-modern { animation-delay: 0.1s; }
.chart-bar-group-modern:nth-child(3) .chart-bar-modern { animation-delay: 0.15s; }
.chart-bar-group-modern:nth-child(4) .chart-bar-modern { animation-delay: 0.2s; }
.chart-bar-group-modern:nth-child(5) .chart-bar-modern { animation-delay: 0.25s; }
.chart-bar-group-modern:nth-child(6) .chart-bar-modern { animation-delay: 0.3s; }
.chart-bar-group-modern:nth-child(7) .chart-bar-modern { animation-delay: 0.35s; }
.chart-bar-group-modern:nth-child(8) .chart-bar-modern { animation-delay: 0.4s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chart-day-bar-modern {
    animation: slideInLeft 0.6s ease-out backwards;
}

.chart-day-row-modern:nth-child(1) .chart-day-bar-modern { animation-delay: 0.1s; }
.chart-day-row-modern:nth-child(2) .chart-day-bar-modern { animation-delay: 0.15s; }
.chart-day-row-modern:nth-child(3) .chart-day-bar-modern { animation-delay: 0.2s; }
.chart-day-row-modern:nth-child(4) .chart-day-bar-modern { animation-delay: 0.25s; }
.chart-day-row-modern:nth-child(5) .chart-day-bar-modern { animation-delay: 0.3s; }
.chart-day-row-modern:nth-child(6) .chart-day-bar-modern { animation-delay: 0.35s; }
.chart-day-row-modern:nth-child(7) .chart-day-bar-modern { animation-delay: 0.4s; }
