/* Popular Times Chart Styles */
.popular-times-widget {
    font-family: 'Inter', sans-serif;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.popular-times-header button {
    transition: all 0.2s ease;
}

.popular-times-chart {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chart-wrapper {
    position: relative;
    overflow: hidden; /* Prevent any overflow */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chart-area {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.bars-container {
    padding: 20px 8px;
    background: linear-gradient(to top, #f1f5f9 0%, transparent 100%);
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.bar-wrapper {
    position: relative;
    min-width: 0;
    touch-action: manipulation;
    flex: 1;
    max-width: calc((100% - 23 * 2px) / 24); /* Account for gaps between bars */
    box-sizing: border-box;
}

.bar {
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    cursor: pointer;
    touch-action: manipulation;
}

.bar:hover, .bar:active {
    transform: scaleY(1.05);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.time-label {
    white-space: nowrap;
    font-size: 10px;
    margin-top: 8px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.percent-label {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    user-select: none;
    pointer-events: none;
}

.day-indicator {
    font-size: 16px;
    color: #374151;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}

.popular-times-header button {
    touch-action: manipulation;
    user-select: none;
}

.hour-tooltip {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive styles for popular times chart */
@media (max-width: 1024px) {
    .popular-times-chart {
        padding: 16px;
        width: 100%;
        max-width: 100%;
    }
    
    .bars-container {
        padding: 15px 6px;
        height: 180px !important;
        gap: 1px !important;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .bar-wrapper {
        max-width: calc((100% - 23 * 1px) / 24); /* Account for 1px gaps */
    }
    
    .bar {
        max-height: 140px !important;
    }
}

@media (max-width: 768px) {
    .popular-times-chart {
        padding: 12px;
        width: 100%;
        max-width: 100%;
    }
    
    .bars-container {
        padding: 12px 4px;
        height: 160px !important;
        gap: 1px !important;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .bar-wrapper {
        max-width: calc((100% - 23 * 1px) / 24); /* Account for 1px gaps */
    }
    
    .bar {
        max-height: 120px !important;
    }
    
    .time-label {
        font-size: 8px;
        transform: rotate(-45deg);
        margin-top: 4px;
        height: 16px;
    }
    
    .percent-label {
        font-size: 8px;
        top: -14px;
    }
    
    .popular-times-header .flex {
        justify-content: center;
        gap: 6px;
    }
    
    .popular-times-header button {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .popular-times-chart {
        padding: 8px;
        border-radius: 0;
        width: calc(100% + 32px);
        max-width: calc(100% + 32px);
    }
    
    .bars-container {
        padding: 10px 2px;
        height: 140px !important;
        gap: 0.5px !important;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .bar-wrapper {
        max-width: calc((100% - 23 * 0.5px) / 24);
    }
    
    .bar {
        max-height: 100px !important;
    }
    
    .time-label {
        font-size: 7px;
        transform: rotate(-50deg);
        margin-top: 2px;
        height: 14px;
    }
    
    .percent-label {
        font-size: 7px;
        top: -12px;
    }
    
    .popular-times-header button {
        font-size: 11px;
        padding: 4px 8px;
    }
}

@media (max-width: 320px) {
    .popular-times-chart {
        padding: 6px;
        width: calc(100% + 32px);
        max-width: calc(100% + 32px);
    }
    
    .bars-container {
        padding: 8px 1px;
        height: 120px !important;
        gap: 0px !important;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .bar-wrapper {
        max-width: calc(100% / 24);
    }
    
    .bar {
        max-height: 80px !important;
    }
    
    .time-label {
        font-size: 6px;
        transform: rotate(-55deg);
        margin-top: 1px;
        height: 12px;
    }
    
    .percent-label {
        display: none; /* Hide percentage labels on very small screens */
    }
    
    .popular-times-header button {
        font-size: 10px;
        padding: 3px 6px;
    }
}
