/* ==========================================================================
   Portfolio Navigation CSS - Overlapping Single Arrows at Image Edges
   White (front) = Projects | Blue (back) = Images
   ========================================================================== */

/* Image Controls Container */
.image-controls {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
}

/* YouTube Video Styles */
.youtube-video {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: var(--radius-md);
}

/* Local MP4/Video Styles */
.local-video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: var(--radius-md);
}

.local-video {
    width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    background: #000;
}

/* Portfolio Video Thumbnail */
.portfolio-video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* YouTube Badge on Portfolio Items */
.youtube-badge {
    display: inline-block;
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    backdrop-filter: blur(10px);
}

/* Video Dot Indicator */
.image-dots .dot.video-dot {
    background: rgba(255, 0, 0, 0.7);
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: white;
}

.image-dots .dot.video-dot:hover {
    background: rgba(255, 0, 0, 0.9);
}

.image-dots .dot.video-dot.active {
    background: #ff0000;
    width: 32px;
}

/* Modal Image Container */
.modal-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.modal-image.has-video {
    background: #000;
    min-height: 400px;
}

/* ========================================================================
   NAVIGATION ARROWS - Overlapping at Image Edges
   ======================================================================== */

/* Base Navigation Arrow Style - Positioned on modal-image container */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: none !important;
    border: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.75;
    pointer-events: auto;
}

.modal-nav:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
}

/* PROJECT NAVIGATION (White) - Front Layer */
#modal-prev-project,
#modal-next-project {
    z-index: 12;
}

#modal-prev-project svg,
#modal-next-project svg {
    fill: #3b82f6;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.7));
}

#modal-prev-project:hover svg,
#modal-next-project:hover svg {
    filter: drop-shadow(0 4px 15px rgba(59,130,246, 0.8));
}

/* IMAGE NAVIGATION (Blue) - Back Layer (slightly offset) */
#modal-prev-image,
#modal-next-image {
    z-index: 11;
}

#modal-prev-image svg,
#modal-next-image svg {
    fill: #d8d8da;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.7));
}

#modal-prev-image:hover svg,
#modal-next-image:hover svg {
    fill: #d8d8da;
    filter: drop-shadow(0 4px 18px rgba(255, 255, 255, 0.9));
}

/* Positioning - Both at same position, overlapping */
#modal-prev-project,
#modal-prev-image {
    left: 40px;
}

#modal-next-project,
#modal-next-image {
    right: 40px;
}

/* Slight offset for blue arrows to create depth */
#modal-prev-image {
    left: 10px; /* 5px mehr nach links */
}

#modal-next-image {
    right: 10px; /* 5px mehr nach rechts */
}

/* Flip the left arrows horizontally */
#modal-prev-project svg,
#modal-prev-image svg {
    transform: scaleX(-1);
}

/* Verstecke die RICHTIGEN Buttons - nach dem Event Listener Tausch */
#modal-prev-project,
#modal-next-project {
    display: none;  /* ← Jetzt verstecken wir die Bild-Navigation per default */
}

/* Projekt-Navigation immer sichtbar */
#modal-prev-image,
#modal-next-image {
    display: flex;  /* ← Projekt-Navigation ist immer sichtbar */
}

/* SVG Icons - Single Chevron */
.modal-nav svg {
    width: 50px;
    height: 50px;
    transition: all 0.3s ease;
}

/* Image Counter */
.image-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    z-index: 10;
}

/* Image Dots Indicator */
.image-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    z-index: 10;
}

.image-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-dots .dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.image-dots .dot.active {
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
    width: 30px;
    border-radius: 5px;
}

/* Portfolio Image Count Badge */
.portfolio-image-count {
    display: inline-block;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    backdrop-filter: blur(10px);
}

/* Modal Image Container Adjustments */
.modal-image img {
    transition: opacity 0.3s ease;
}

.modal-image img.changing {
    opacity: 0.5;
}

/* Video Controls Visibility */
.local-video::-webkit-media-controls-panel {
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8));
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .modal-nav {
        width: 45px;
        height: 45px;
    }
    
    .modal-nav svg {
        width: 45px;
        height: 45px;
    }
    
    #modal-prev-project,
    #modal-prev-image {
        left: 12px;
    }
    
    #modal-next-project,
    #modal-next-image {
        right: 12px;
    }
    
    #modal-prev-image {
        left: 8px;
    }
    
    #modal-next-image {
        right: 8px;
    }
    
    .image-counter {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .image-dots {
        bottom: 15px;
        gap: 8px;
        padding: 8px 16px;
    }
    
    .image-dots .dot {
        width: 8px;
        height: 8px;
    }
    
    .image-dots .dot.active {
        width: 24px;
    }
    
    .image-dots .dot.video-dot {
        width: 10px;
        height: 10px;
    }
    
    .image-dots .dot.video-dot.active {
        width: 28px;
    }
    
    .youtube-video,
    .local-video {
        max-height: 50vh;
    }
}

@media (max-width: 767px) {
    .modal-nav {
        width: 40px;
        height: 40px;
    }
    
    .modal-nav svg {
        width: 40px;
        height: 40px;
    }
    
    #modal-prev-project,
    #modal-prev-image {
        left: 10px;
    }
    
    #modal-next-project,
    #modal-next-image {
        right: 10px;
    }
    
    #modal-prev-image {
        left: 6px;
    }
    
    #modal-next-image {
        right: 6px;
    }
    
    .image-counter {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .image-dots {
        bottom: 10px;
        gap: 6px;
        padding: 6px 12px;
    }
    
    .image-dots .dot {
        width: 7px;
        height: 7px;
    }
    
    .image-dots .dot.active {
        width: 20px;
    }
    
    .image-dots .dot.video-dot {
        width: 9px;
        height: 9px;
        font-size: 7px;
    }
    
    .image-dots .dot.video-dot.active {
        width: 24px;
    }
    
    .portfolio-image-count {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .youtube-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .youtube-video,
    .local-video {
        max-height: 40vh;
    }
}

@media (max-width: 576px) {
    .modal-nav {
        width: 38px;
        height: 38px;
    }
    
    .modal-nav svg {
        width: 38px;
        height: 38px;
    }
    
    /* Keep both arrows on small screens, just slightly smaller */
    #modal-prev-image {
        left: 5px;
    }
    
    #modal-next-image {
        right: 5px;
    }
}

/* Animation for image transition */
@keyframes imageSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-image img,
.modal-image video {
    animation: imageSlideIn 0.3s ease;
}

/* Touch feedback */
.modal-nav:active {
    transform: translateY(-50%) scale(0.9);
}

.image-dots .dot:active {
    transform: scale(0.9);
}

/* Loading State for Videos */
.local-video-container::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

.local-video-container video:not([src=""]) ~ ::before {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Transitions */
.modal-nav {
    transition: opacity 0.3s ease, 
                transform 0.3s ease;
}

/* When hovering over the white arrow, make sure it stays on top */
#modal-prev-project:hover,
#modal-next-project:hover {
    z-index: 13;
}