/* Video Heatmap Styles */
.revst-video-heatmap-container {
    max-width: 100%;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-align: center;
}

/* Inner content wrapper */
.revst-video-heatmap-container > div {
    /* display: inline-block; */
    width: 100%;
}

/* When specific width is set, ensure proper centering */
.revst-video-container[style*="width"],
.revst-segments-heatmap[style*="width"] {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Video Selector Section */
.revst-video-selector {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* text-align: left; */
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

/* Statistics Section */
.revst-video-stats {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* text-align: left; */
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.revst-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.revst-stat-box {
    flex: 1;
    /* min-width: 200px; */
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.revst-stat-icon {
    font-size: 32px;
    color: #007cba;
    /* margin-bottom: 10px; */
}

.revst-stat-icon .dashicons {
    width: 32px;
    height: 32px;
    font-size: 32px;
}

.revst-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-top: 5px;
}

.revst-stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 0;
}

/* Video Container */
.revst-video-container {
    position: relative;
    background: #000;
    /* border-radius: 8px; */
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: inline-block;
    max-width: 960px;
    margin: 0 auto;
    text-align: left;
}

.revst-loading {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    margin: 0 auto;
}

.revst-loading .dashicons {
    margin-right: 8px;
    animation: revst-spin 2s linear infinite;
}

@keyframes revst-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Video Player */
.revst-video-player {
    width: 100%;
    position: relative;
    display: inline-block;
}

.revst-video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Segments Heatmap */
.revst-segments-heatmap {
    background: rgba(0,0,0,0.8);
    padding: 20px 0;
    position: relative;
    transition: background 0.2s ease;
    margin: 0 auto;
    display: inline-block;
    box-sizing: border-box;
}

.played-segments {
    position: relative;
    display: inline-block;
}

.played-segments .curve {
    display: block;
    width: 100%;
    height: 60px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    margin: 0 auto;
}

.played-segments .curve:hover {
    opacity: 0.9;
}

/* Highlight effect on hover */
.revst-segments-heatmap:hover {
    background: rgba(0,0,0,0.85);
}

/* Sparkline tooltip */
.jqstooltip {
    position: absolute;
    display: block !important;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.4;
    background: rgba(0,0,0,0.9) !important;
    color: #fff !important;
    border: 1px solid #333 !important;
    border-radius: 4px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.jqstooltip small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
}

/* Video Report Container */
[id^="video_report_"] {
    display: inline-block;
    width: 100%;
}

/* Progress info */
.revst-progress-info {
    color: #fff;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .revst-stats-row {
        flex-direction: column;
    }
    
    .revst-stat-box {
        min-width: 100%;
    }
    
    /* Allow video container to shrink on mobile */
    .revst-video-container,
    .revst-segments-heatmap,
    .played-segments,
    .revst-video-stats {
        max-width: 100% !important;
        width: auto !important;
        margin-left: 10px !important;
        margin-right: 10px !important;
    }
    
    .revst-video-player iframe {
        max-width: 100%;
        height: auto;
    }
}

/* Video heatmap colors */
.revst-heatmap-low {
    fill: #F44336;
}

.revst-heatmap-medium {
    fill: #FF9800;
}

.revst-heatmap-high {
    fill: #FFC107;
}

.revst-heatmap-very-high {
    fill: #4CAF50;
}
