/**
 * Landing Page Slideshow Styles
 */

/* Prevent landscape orientation - DISABLED */
/* @media (orientation: landscape) and (max-width: 1024px) {
    #landingSlideshow::after {
        content: 'Please rotate your device to portrait mode';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #1a1a1a;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        text-align: center;
        padding: 20px;
        z-index: 9999;
    }

    .slideshow-wrapper {
        display: none !important;
    }
} */

/* Hide main app elements when slideshow is active */
#landingSlideshow:not([style*="display: none"]) ~ .card-stack,
#landingSlideshow:not([style*="display: none"]) ~ .photo-slots,
#landingSlideshow:not([style*="display: none"]) ~ .matches-row,
#landingSlideshow:not([style*="display: none"]) ~ #matchCard,
#landingSlideshow:not([style*="display: none"]) ~ #chatFab {
    display: none !important;
}

.slideshow-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100vh;
    z-index: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #515571 0%, #3d3d52 100%);
}

/* On desktop (500px+), add dark background and cap width at 500px */
@media (min-width: 500px) {
    /* Dark background only on true desktop */
    #landingSlideshow::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #1a1a1a;
        z-index: 0;
    }

    .slideshow-wrapper {
        width: 500px;
        max-width: 500px;
    }
}

.slide-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.slide-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}

/* Remove padding for Slide 1 and Slide 17 to allow full width */
.slide-container[data-slide="0"],
.slide-container[data-slide="16"] {
    padding: 0;
}

.slide-image-wrapper[data-slide="0"],
.slide-image-wrapper[data-slide="16"] {
    padding: 0;
}

/* Position images on Slide 1 and Slide 17 identically - positioned high near top and full width */
.slide-image-wrapper[data-slide="0"] .slide-image,
.slide-image-wrapper[data-slide="16"] .slide-image {
    transform: translateY(-120px);
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

/* Slide 7 - system2.jpg - display edge to edge full width */
.slide-container[data-slide="6"] {
    padding: 0;
}

.slide-image-wrapper[data-slide="6"] {
    padding: 0;
}

.slide-image-wrapper[data-slide="6"] .slide-image {
    transform: translateY(-120px);
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

.slide-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.1s ease-in-out;
    opacity: 1;
}

/* Text navigation arrows */
.text-nav-arrow {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.text-nav-arrow svg {
    width: 18px;
    height: 18px;
}

.text-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.text-nav-arrow:active {
    transform: scale(0.95);
}

/* Text overlay band */
.slide-overlay {
    position: absolute;
    left: 0;
    right: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.65) 100%
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px 18px 24px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: top 0.2s ease, opacity 0.2s ease;
    /* Top will be set via JavaScript in pixels based on image position */
    /* Start hidden until position is calculated to prevent jump from top */
    opacity: 0;
}

.slide-overlay.positioned {
    opacity: 1;
}

.slide-overlay.scrubbing {
    transition: none !important;
}

/* Triangle pointer - hidden by default */
.slide-overlay::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0; /* Hide by default */
    transition: top 0.2s ease, bottom 0.2s ease, left 0.2s ease, opacity 0.2s ease, border-width 0.2s ease;
    left: var(--pointer-left, 50%);
    transform: translateX(-50%);
    opacity: 0;
}

/* Pointing up (triangle above text bar pointing upward) */
.slide-overlay.pointer-up::before {
    top: -24px;
    border-width: 0 24px 24px 24px;
    border-color: transparent transparent rgba(0, 0, 0, 0.75) transparent;
    opacity: 1;
}

/* Pointing down (triangle below text bar pointing downward) */
.slide-overlay.pointer-down::before {
    bottom: -24px;
    border-width: 24px 24px 0 24px;
    border-color: rgba(0, 0, 0, 0.65) transparent transparent transparent;
    opacity: 1;
}

.slide-text {
    color: white;
    font-size: 19px;
    line-height: 1.4;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.2px;
    margin-bottom: 12px;
    transition: opacity 0.15s ease-out;
}

.slide-text.fading {
    opacity: 0;
}

.slide-text[style*="italic"] {
    opacity: 0.75;
}

/* Controls container - now horizontal layout with arrows on sides */
.slide-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 4px;
}

/* Slide counter */
.slide-counter {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.current-slide {
    font-size: 16px;
    font-weight: 600;
}

.total-slides {
    font-size: 13px;
    opacity: 0.8;
}

/* Scrubber / Progress bar */
.slide-scrubber {
    flex: 1;
    max-width: 250px;
    padding: 0 0 8px 0;
    margin: 0 16px;
}

.scrubber-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.2s ease;
}

.scrubber-track:hover {
    height: 6px;
}

.scrubber-track.dragging {
    height: 6px;
    transition: none;
}

.scrubber-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    pointer-events: none;
    transition: width 0.2s ease;
}

.scrubber-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transition: left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.scrubber-track:hover .scrubber-thumb {
    width: 14px;
    height: 14px;
}

/* Responsive design - mobile adjustments */
@media (max-width: 499px) {
    .slide-container {
        padding: 20px;
    }

    .slide-image-wrapper {
        border-radius: 16px;
        padding: 15px;
    }

    .slide-overlay {
        top: 50px;
        padding: 24px 12px 18px;
    }

    .slide-text {
        font-size: 20px;
        line-height: 1.4;
    }

    .text-nav-arrow {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .text-nav-arrow svg {
        width: 20px;
        height: 20px;
    }

    .slide-counter {
        font-size: 12px;
    }

    .current-slide {
        font-size: 14px;
    }

    .total-slides {
        font-size: 11px;
    }

    .slide-image {
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .slide-container {
        padding: 15px;
    }

    .slide-image-wrapper {
        border-radius: 12px;
        padding: 10px;
    }

    .slide-overlay {
        padding: 18px 24px 15px;
    }

    .slide-text {
        font-size: 16px;
    }

    .text-nav-arrow {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .text-nav-arrow svg {
        width: 18px;
        height: 18px;
    }
}

/* Loading state */
.slide-image[src=""] {
    opacity: 0;
}

.slide-image {
    opacity: 1;
    transition: opacity 0.1s ease;
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .text-nav-arrow {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .text-nav-arrow svg {
        width: 18px;
        height: 18px;
    }
}
