/* MontaVis Video Player Styles */

/* Video Thumbnail Container - Enhanced Dark Mode */
.video-showcase-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 8px; /* Reduced from 16px to 8px for less space */
    border-radius: 24px;
    overflow: hidden;
    background-color: #141416; /* Slightly lighter than background for depth */
    border: 1px solid rgba(255, 255, 255, 0.06); /* More subtle border */
    transition: box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: none; /* Ensure no transform is applied by default */
    height: auto;
    max-height: none;
    padding-top: 0;
    box-sizing: border-box;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 15px rgba(100, 181, 246, 0.15); /* Enhanced glow */
}

.video-center-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.video-center-column.full-width {
    max-width: 1000px;
    margin: 0 auto;
}

.video-section-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.video-section-container.centered {
    flex-direction: column;
}

.video-showcase-container:hover {
    transform: none !important; /* Force no transform with !important */
    box-shadow: 0 20px 40px rgba(10, 132, 255, 0.15), 
                0 0 20px rgba(10, 132, 255, 0.1);
}

.video-thumbnail {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    display: block;
    position: relative;
    transition: none; /* Remove any transition that might be applied */
    transform: none; /* Ensure no transform is applied */
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.video-thumbnail:hover {
    transform: none !important; /* Force no transform */
}

/* Video Play Button with simplified subtle animation */
.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    
    /* Clean glassmorphism effect */
    background: rgba(30, 30, 40, 0.3);
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px);
    
    /* Subtle inner glow */
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    
    border: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden; /* Important for containing the shine effect */
    animation: none; /* Remove bounce animation */
}

/* Remove the previous ::before and ::after animations */
.video-play-button::before,
.video-play-button::after {
    content: none; /* Remove ring animations */
}

/* Bright white play button icon */
.video-play-button svg {
    width: 44px;
    height: 44px;
    fill: #FFFFFF;
    margin-left: 6px;
    position: relative;
    animation: none; /* Remove arrow motion animation */
}

/* New subtle shine effect moving from left to right */
.video-play-button .dark-shine {
    position: absolute;
    top: -100%;
    left: -200%;
    width: 200%;
    height: 300%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: subtle-shine 3.5s ease-in-out infinite;
    opacity: 0.8;
}

/* Subtle left-to-right shine animation */
@keyframes subtle-shine {
    0% {
        left: -200%;
    }
    100% {
        left: 200%;
    }
}

/* Clean hover effect with slight scale */
.video-play-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    background-color: rgba(40, 40, 60, 0.4);
}

/* Restart Button - Matching refined style */
.video-restart-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    
    background: rgba(30, 30, 40, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    /* Subtle inner glow instead of outer glow */
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    
    border: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
}

.video-restart-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    background-color: rgba(40, 40, 60, 0.4);
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.video-restart-button svg {
    width: 44px;
    height: 44px;
    fill: #FFFFFF !important; /* Pure white with !important */
    color: #FFFFFF !important;
    filter: none;
    transition: transform 0.3s ease;
}

.video-restart-button .dark-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 30%,
        rgba(255, 255, 255, 0) 70%
    );
    opacity: 0;
    animation: pulseGlow 5s ease-in-out infinite;
}

.video-restart-button.visible {
    opacity: 1;
    visibility: visible;
}

/* External timeline controls - brightened elements */
.external-timeline-controls {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px 20px;
    padding-top: 20px;
    background-color: rgba(20, 20, 30, 0.6); /* Slightly more transparent */
    backdrop-filter: blur(10px); /* Add blur for consistency */
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 1px rgba(100, 181, 246, 0.2);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.08);
    height: 110px; /* noch etwas höher für mehr Abstand */
    min-height: 110px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    margin-top: 4px; /* Reduced from 8px to 4px */
    transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), 
                visibility 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-sizing: border-box;
    overflow: visible;
    display: block;
}

.external-timeline-controls.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block;
}

/* Timeline Container */
.timeline-container {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.06); /* More subtle background */
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    margin-bottom: 12px;
    overflow: visible;
    z-index: 11;
}

/* Background zones showing the different sections */
.timeline-bg-zone-1 {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--zone1-width, 20%);
    height: 100%;
    background-color: rgba(255, 69, 58, 0.1); /* Light red zone 1 */
    border-radius: 3px 0 0 3px;
    z-index: 1;
}

.timeline-bg-zone-2 {
    position: absolute;
    top: 0;
    left: var(--zone1-width, 20%);
    width: var(--zone2-width, 62.7%);
    height: 100%;
    background-color: rgba(10, 132, 255, 0.1); /* Light blue zone */
    z-index: 1;
}

.timeline-bg-zone-3 {
    position: absolute;
    top: 0;
    left: var(--zone2-end, 82.7%);
    width: var(--zone3-width, 17.3%);
    height: 100%;
    background-color: rgba(255, 69, 58, 0.1); /* Light red zone 2 */
    border-radius: 0 3px 3px 0;
    z-index: 1;
}

/* COMPLETELY NEW PROGRESS BAR IMPLEMENTATION */
/* Base progress bar container - fully transparent */
.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%; /* This will be controlled by JS, but won't be visible itself */
    z-index: 2;
    background-color: transparent;
}

/* Zone progress bars */
.zone-progress {
    position: absolute;
    top: 0;
    height: 100%;
    width: 0; /* Will be updated by JS */
    transition: width 0.65s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: width;
    z-index: 2;
}

/* Zone 1: Red from 0% to zone1-end */
.zone-progress-1 {
    left: 0;
    background-color: #FF453A;
    border-radius: 3px 0 0 3px;
    max-width: var(--zone1-width, 20%);
}

/* Zone 2: Blue from zone1-end to zone2-end */
.zone-progress-2 {
    left: var(--zone1-width, 20%);
    background-color: #0A84FF;
    max-width: var(--zone2-width, 62.7%);
}

/* Zone 3: Red from zone2-end to 100% */
.zone-progress-3 {
    left: var(--zone2-end, 82.7%);
    background-color: #FF453A;
    border-radius: 0 3px 3px 0;
    max-width: var(--zone3-width, 17.3%);
}

/* Handle position - Apple Dark Mode Style with white color */
.timeline-handle {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    width: 12px; /* Slightly smaller for Apple-like subtlety */
    height: 12px;
    background-color: rgba(255, 255, 255, 0.9); /* White with slight transparency */
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 
                0 1px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    opacity: 1; /* Always visible */
    transition: transform 0.15s ease, background-color 0.15s ease, left 0.65s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: left, transform;
    border: none; /* Remove border for cleaner look */
    z-index: 15; /* Ensure it's above other elements */
    pointer-events: auto;
}

/* Subtle hover effect */
.timeline-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: #FFFFFF; /* Pure white on hover */
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 
                0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Active state for when dragging */
.timeline-handle:active {
    transform: translate(-50%, -50%) scale(1.15);
    background-color: #F5F5F5; /* Slightly off-white on active */
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4), 
                0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Remove old timeline stuff */
.timeline-progress::before {
    display: none;
}

/* Timeline Info */
.timeline-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #FFFFFF; /* White text for dark mode */
    font-size: 0.9rem;
    z-index: 11;
}

.timeline-current-time, 
.timeline-duration {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 500; /* Slightly bolder text */
    min-width: 40px;
    color: rgba(255, 255, 255, 0.9); /* Brighter text for better contrast */
}

/* Timeline Buttons */
.timeline-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex: 1;
}

.timeline-button {
    background: none;
    border: none;
    color: #FFFFFF;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    padding: 0;
}

.timeline-button:hover {
    transform: scale(1.2);
}

/* Bootstrap icon styling for timeline buttons */
.timeline-button i.bi {
    font-size: 22px;
    color: #FFFFFF;
    line-height: 1;
}

/* Make sure all bootstrap icons in buttons have consistent styling */
.timeline-button i.bi-arrow-counterclockwise,
.timeline-button i.bi-play-fill,
.timeline-button i.bi-pause-fill {
    color: #FFFFFF !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Play/Pause Icons */
#playPauseButton .play-icon {
    display: block;
}

#playPauseButton .pause-icon {
    display: none;
}

#playPauseButton.playing .play-icon {
    display: none;
}

#playPauseButton.playing .pause-icon {
    display: block;
}

/* Make sure icons display properly on mobile */
@media (max-width: 768px) {
    .timeline-button i.bi {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .timeline-button i.bi {
        font-size: 18px;
    }
}

@media (max-width: 375px) {
    .timeline-button {
        width: 24px;
        height: 24px;
    }
    
    .timeline-button i.bi {
        font-size: 16px;
    }
}

/* Apple-style play prompt below video */
.video-play-prompt {
    text-align: center;
    margin: 8px auto 10px;
    max-width: 1000px;
    width: 100%;
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
                visibility 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.video-play-prompt.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px); /* Move up when hiding */
    display: none; /* Added to ensure it's completely hidden */
}

.video-play-prompt p {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(12px, 2.5vw, 16px);
    color: rgba(255, 255, 255, 0.8); /* Brighter text for better visibility */
    line-height: 1.4;
    letter-spacing: -0.01em;
    font-weight: 500;
    margin: 12px 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    padding: 0;
    width: 100%;
}

/* Create a spacer to prevent layout shifts */
.video-controls-spacer {
    height: 125px; /* Increased from 115px to accommodate taller play prompt */
    position: relative;
    margin-bottom: 10px;
    margin-top: 8px; /* Reduced from 16px to 8px */
    max-width: 1000px; /* Match video container width */
    width: 100%; /* Set to 100% to match the container width */
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    display: block; /* Ensure it's displayed */
    z-index: 1;
}

/* Responsive adjustments for the prompt */
@media (max-width: 768px) {
    .video-play-prompt {
        margin: 12px auto 16px;
        max-width: 90%;
    }
    
    .video-play-prompt p {
        font-size: 14px;
    }
    
    .video-play-button,
    .video-restart-button {
        width: 80px;
        height: 80px;
    }
    
    .video-play-button svg,
    .video-restart-button svg {
        width: 36px;
        height: 36px;
    }
    
    @keyframes attention-ring {
        0% {
            width: 100%;
            height: 100%;
            opacity: 0.5;
        }
        100% {
            width: 150%;
            height: 150%;
            opacity: 0;
        }
    }
}

/* Source selection based on screen size */
.desktop-video-source, .mobile-video-source {
    display: none;
}

@media (max-width: 768px) {
    .video-thumbnail {
        /* Change aspect ratio for mobile to be more portrait-oriented */
        aspect-ratio: 4/5; /* More portrait ratio for mobile */
    }
    
    .video-showcase-container {
        width: 100%; /* Full width on mobile */
        max-width: 100%;
        margin: 0 0 8px;
        border-radius: 0; /* Remove border radius for full-width effect */
    }
    
    /* Improved video display for mobile - crop to center to focus on important content */
    .video-animation {
        object-fit: cover;
        object-position: center 40%; /* Adjust vertical position to focus on hands/activity */
        transform: scale(1.2); /* Zoom in slightly to focus on the important elements */
    }
}

@media (max-width: 576px) {
    .video-thumbnail {
        /* Even more portrait-oriented for small phones */
        aspect-ratio: 3/5;
    }
    
    .video-showcase-container {
        width: 100%;
        margin: 0 0 6px;
    }
    
    /* Even more focused view for small phones */
    .video-animation {
        object-position: center 45%;
        transform: scale(1.3); /* More zoom on smaller devices */
    }
    
    .video-play-button,
    .video-restart-button {
        width: 70px;
        height: 70px;
    }
    
    .video-play-button svg,
    .video-restart-button svg {
        width: 32px;
        height: 32px;
        margin-left: 4px;
    }
}

@media (max-width: 375px) {
    .video-showcase-container {
        border-radius: 8px;
    }
    
    .external-timeline-controls {
        border-radius: 8px;
        padding: 6px 8px;
    }
    
    .video-play-button, 
    .video-restart-button {
        width: 60px;
        height: 60px;
    }
    
    .video-play-button svg, 
    .video-restart-button svg {
        width: 24px;
        height: 24px;
    }
}

/* Timeline Zone Labels */
.timeline-zone-labels {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 8px; /* mehr Abstand zur Timeline */
    padding-bottom: 0;
    position: relative;
    z-index: 12;
    pointer-events: none;
}

.timeline-zone-label-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    pointer-events: none;
}

.timeline-zone-label-line {
    border-top-style: dashed;
    border-top-width: 2px;
    height: 0;
    min-width: 12px;
    flex: 1 1 auto;
    margin: 0 6px;
    pointer-events: none;
    opacity: 0.7;
}

.timeline-zone-label {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 400;
    opacity: 0.8;
    letter-spacing: 0.01em;
    white-space: nowrap;
    padding: 0 2px;
    background: none;
    text-shadow: none;
    pointer-events: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}