/* MontaVis Video Hints */

/* Video Hint Overlay */
.video-hint-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; /* Removed darkening background */
    z-index: 10;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-hint-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Annotated Frame Overlay */
.annotated-frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* Above video but below hint overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: transparent;
}

.annotated-frame-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Enhanced Hint Container with improved visibility */
.video-hint-container {
    background-color: rgba(40, 40, 60, 0.5); /* Slightly more visible background */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 24px 28px; /* Larger padding for better readability */
    margin: 30px;
    max-width: 420px; /* Increased width for large screens */
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 0 20px rgba(100, 181, 246, 0.2); /* Subtle blue glow */
    border: none;
    animation: fadeInFromTop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    position: relative;
    padding-top: 28px; /* More space for the icon */
}

@keyframes hint-appear {
    0% {
        opacity: 0;
        transform: translateY(-20px); /* Start above final position */
    }
    100% {
        opacity: 1;
        transform: translateY(0); /* End at natural position */
    }
}

/* AI Icon for the hint container - brighter */
.hint-ai-icon {
    position: absolute;
    top: -18px;
    left: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(10, 132, 255, 1.0); /* Full opacity blue */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(10, 132, 255, 0.5); /* Enhanced glow */
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Style for the Bootstrap icon - brighter */
.hint-ai-icon i.bi {
    font-size: 20px;
    color: white;
}

/* Keep existing SVG styling for backward compatibility */
.hint-ai-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Hint Text - Larger and brighter for better readability */
.video-hint-text {
    color: #FFFFFF; /* Pure white for better contrast */
    font-size: 16px; /* Increased from 14px */
    line-height: 1.5;
    font-weight: 400;
    margin-bottom: 20px; /* More space before button */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Continue Button - Enhanced contrast and visibility */
.video-hint-button {
    background-color: rgba(10, 132, 255, 0.8); /* Brighter blue background */
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 24px;
    font-size: 16px; /* Increased from 14px */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.video-hint-button:hover {
    background-color: rgba(10, 132, 255, 1.0);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.video-hint-button:active {
    transform: scale(0.98);
    background-color: rgba(255, 255, 255, 0.2);
}

/* Timeline Hint Marker - Apple-inspired design */
.timeline-hint-marker {
    position: absolute;
    top: -5px;
    width: 4px;
    height: 18px; /* Taller marker for better visibility */
    background-color: #0A84FF;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1), 
                background-color 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 4;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Different colors for different hint types - brighter */
.timeline-hint-marker[data-hint-type="start"] {
    background-color: rgba(10, 132, 255, 1.0); /* Brighter blue */
}

.timeline-hint-marker[data-hint-type="tools"] {
    background-color: rgba(255, 214, 10, 1.0); /* Brighter yellow */
}

.timeline-hint-marker[data-hint-type="result"] {
    background-color: rgba(10, 132, 255, 1.0); /* Brighter blue */
}

.timeline-hint-marker[data-hint-type="remove"] {
    background-color: rgba(255, 69, 58, 1.0); /* Brighter red */
}

.timeline-hint-marker:hover {
    transform: scaleY(1.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Timeline labels - brighter text */
.timeline-marker-label {
    position: absolute;
    bottom: -22px;
    transform: translateX(-50%);
    font-size: 12px; /* Increased from 11px */
    color: rgba(255, 255, 255, 0.8); /* Much brighter for dark background */
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap; /* Will be changed to normal on small screens */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    pointer-events: none;
    text-align: center;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    width: auto; /* Default width */
    max-width: none; /* Default max-width */
}

/* On hover state */
.timeline-hint-marker:hover + .timeline-marker-label {
    transform: translateX(-50%) translateY(-2px);
    color: rgba(10, 132, 255, 1); /* Changed to blue on hover for better visibility */
}

/* Hide old tooltip */
.timeline-hint-tooltip {
    display: none;
}

/* Remove dot-related styles */
.timeline-marker-dot {
    display: none;
}

/* Add these position classes */
/* Container positioning classes */
.video-hint-container.position-top-left {
    top: 30px;
    left: 30px;
    transform-origin: top left;
}

.video-hint-container.position-top-right {
    top: 30px;
    right: 30px;
    left: auto;
    transform-origin: top right;
}

.video-hint-container.position-bottom-left {
    top: auto;
    bottom: 30px;
    left: 30px;
    transform-origin: bottom left;
}

.video-hint-container.position-bottom-right {
    top: auto;
    bottom: 30px;
    right: 30px;
    left: auto;
    transform-origin: bottom right;
}

/* Video Capture Icon - brighter */
.video-capture-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 8;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), 
                visibility 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), 
                transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translateY(-20px); /* Start above final position */
}

.video-capture-icon.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* End at natural position */
}

.capture-icon-container {
    display: flex;
    align-items: center;
    background-color: rgba(10, 132, 255, 0.9); /* Brighter blue */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(10, 132, 255, 0.4); /* Enhanced glow */
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.capture-icon-container i {
    color: white;
    font-size: 18px;
    margin-right: 8px;
}

.capture-label {
    color: white;
    font-size: 15px; /* Increased from 14px */
    font-weight: 600; /* Bolder for better visibility */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
}

/* Red Overlay with Trash Icon for Hint 4 */
.removal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 69, 58, 0.3); /* Red with 30% opacity */
    z-index: 7; /* Above video but below hint overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none; /* Allow clicks to pass through */
}

.removal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.trash-icon-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 69, 58, 0.8);
    animation: pulse-scale 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.trash-icon-container i {
    color: rgba(255, 69, 58, 0.9);
    font-size: 40px;
}

@keyframes pulse-scale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive adjustments for trash icon */
@media (max-width: 768px) {
    .trash-icon-container {
        width: 60px;
        height: 60px;
    }
    
    .trash-icon-container i {
        font-size: 30px;
    }
}

@media (max-width: 576px) {
    .trash-icon-container {
        width: 50px;
        height: 50px;
    }
    
    .trash-icon-container i {
        font-size: 24px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-hint-container {
        margin: 15px;
        max-width: 70%; /* Reduce width to show more of the video */
        padding: 12px 16px;
        padding-top: 20px;
    }
    
    .hint-ai-icon {
        top: -16px;
        left: 16px;
        width: 32px;
        height: 32px;
    }
    
    .hint-ai-icon svg {
        width: 18px;
        height: 18px;   
    }
    
    .hint-ai-icon i.bi {
        font-size: 18px;
    }
    
    .video-hint-text {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .video-hint-button {
        padding: 6px 16px;
        font-size: 13px;
    }

    /* Always position hint at top left on mobile to maximize visible video */
    .video-hint-container.position-top-left,
    .video-hint-container.position-top-right,
    .video-hint-container.position-bottom-left,
    .video-hint-container.position-bottom-right {
        top: 15px;
        left: 15px;
        right: auto;
        bottom: auto;
        transform-origin: top left;
    }

    .timeline-marker-label {
        font-size: 9px;
        bottom: -20px;
        max-width: 60px; /* Limit width to prevent overlap */
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Reduce vertical space between timeline and labels */
    .timeline-container {
        margin-bottom: 30px !important;
    }
    
    .timeline-marker-dot {
        width: 5px;
        height: 5px;
        margin-bottom: 3px;
    }

    .video-capture-icon {
        top: 15px;
        right: 15px;
    }
    
    .capture-icon-container {
        padding: 5px 10px;
    }
    
    .capture-icon-container i {
        font-size: 16px;
    }
    
    .capture-label {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .video-hint-container {
        margin: 10px;
        max-width: 85%; /* Wider on very small screens to keep text readable */
        padding: 12px 14px;
        padding-top: 20px;
    }
    
    .hint-ai-icon {
        top: -14px;
        left: 14px;
        width: 28px;
        height: 28px;
    }
    
    .hint-ai-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .hint-ai-icon i.bi {
        font-size: 16px;
    }
    
    .video-hint-text {
        font-size: 12px;
        line-height: 1.3;
        margin-bottom: 12px;
    }
    
    .video-hint-button {
        padding: 5px 14px;
        font-size: 12px;
    }

    /* Update position for very small screens */
    .video-hint-container.position-top-left,
    .video-hint-container.position-top-right,
    .video-hint-container.position-bottom-left,
    .video-hint-container.position-bottom-right {
        top: 10px;
        left: 10px;
    }

    .timeline-hint-marker {
        top: -4px;
        width: 3px;
        height: 12px;
    }
    
    .timeline-container {
        margin-bottom: 50px !important; /* Increased space for multiple rows */
    }
    
    .timeline-marker-label {
        font-size: 8px;
        bottom: -18px;
        max-width: 40px; /* More compact on phones */
        white-space: normal; /* Allow text wrapping on small screens */
        line-height: 1.1; /* Tighter line height for wrapped text */
        height: auto; /* Allow height to adjust based on content */
    }
    
    /* Improved staggered positioning for labels to prevent overlap */
    .timeline-hint-marker:nth-of-type(4n+1) + .timeline-marker-label {
        bottom: -18px; /* First row */
        transform: translateX(-50%);
    }
    
    .timeline-hint-marker:nth-of-type(4n+2) + .timeline-marker-label {
        bottom: -36px; /* Second row */
        transform: translateX(-45%); /* Slight offset */
    }
    
    .timeline-hint-marker:nth-of-type(4n+3) + .timeline-marker-label {
        bottom: -18px; /* Back to first row */
        transform: translateX(-55%); /* Different offset */
    }
    
    .timeline-hint-marker:nth-of-type(4n+4) + .timeline-marker-label {
        bottom: -36px; /* Second row */
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    /* New breakpoint for very small screens like the one in the screenshot */
    .timeline-marker-label {
        font-size: 7px;
        max-width: 35px;
    }

    /* More aggressive staggering for very small screens */
    .timeline-hint-marker:nth-of-type(2n+1) + .timeline-marker-label {
        bottom: -16px; /* First row */
        transform: translateX(-60%);
    }
    
    .timeline-hint-marker:nth-of-type(2n+2) + .timeline-marker-label {
        bottom: -34px; /* Second row */
        transform: translateX(-40%);
    }
}

@media (max-width: 400px) {
    .video-hint-container {
        margin: 8px;
        max-width: calc(100% - 16px); /* Almost full width but with margins */
        padding: 10px 12px;
        padding-top: 18px;
    }
    
    .hint-ai-icon {
        top: -12px;
        left: 12px;
        width: 24px;
        height: 24px;
    }
    
    .hint-ai-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .hint-ai-icon i.bi {
        font-size: 14px;
    }
    
    .video-hint-text {
        font-size: 11px;
        margin-bottom: 10px;
    }
    
    .video-hint-button {
        padding: 4px 12px;
        font-size: 11px;
    }

    /* Even tighter placement on very small screens */
    .video-hint-container.position-top-left,
    .video-hint-container.position-top-right,
    .video-hint-container.position-bottom-left,
    .video-hint-container.position-bottom-right {
        top: 8px;
        left: 8px;
    }
    
    .timeline-container {
        margin-bottom: 55px !important; /* Even more space for multiple rows */
    }
    
    .timeline-marker-label {
        font-size: 6.5px;
        max-width: 30px;
        font-weight: 600; /* Bolder text for better readability at small sizes */
    }
    
    /* Create three rows of staggered labels for very small screens */
    .timeline-hint-marker:nth-of-type(1) + .timeline-marker-label {
        bottom: -16px;
        transform: translateX(-70%);
    }
    
    .timeline-hint-marker:nth-of-type(2) + .timeline-marker-label {
        bottom: -34px;
        transform: translateX(-35%);
    }
    
    .timeline-hint-marker:nth-of-type(3) + .timeline-marker-label {
        bottom: -16px;
        transform: translateX(-30%);
    }
    
    .timeline-hint-marker:nth-of-type(4) + .timeline-marker-label {
        bottom: -34px;
        transform: translateX(-65%);
    }
}

@media (max-width: 992px) {
    /* Hide timeline labels on tablets and phones */
    .timeline-marker-label {
        display: none !important;
    }
    
    /* Ensure the timeline has proper spacing without the labels */
    .timeline-container {
        margin-bottom: 15px !important;
    }
}

/* Media query for larger screens */
@media (min-width: 1200px) {
    .video-hint-container {
        max-width: 480px; /* Even larger on very big screens */
        padding: 28px 32px;
    }
    
    .video-hint-text {
        font-size: 18px;
        line-height: 1.5;
    }
    
    .video-hint-button {
        padding: 10px 28px;
        font-size: 17px;
    }
}
