/* Featured Shorts - Vertical Video Carousel */

/* ============================================
   SECTION & HEADING
   ============================================ */

.infotel-featured-shorts {
    margin: 2rem 0;
    padding: 2rem 0 0 0; /* Side padding for arrows, no bottom padding to avoid gap */
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    position: relative;
}

.infotel-featured-shorts__heading {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #fff;
    text-align: center;
}

/* ============================================
   CAROUSEL (SWIPER)
   ============================================ */

.shorts-carousel {
    overflow: hidden !important; /* Hide overflow to crop slides */
    width: 100%; /* Full width to match other sections */
    max-width: 100%; /* No max-width restriction */
    padding: 0; /* No padding - let it touch edges like other sections */
    position: relative; /* For absolute positioning of arrows */
    height: auto !important; /* Prevent Swiper from collapsing */
    min-height: auto; /* Auto height to fit content */
}

/* Hide scrollbar completely on desktop */
.shorts-carousel::-webkit-scrollbar {
    display: none;
}

.shorts-carousel {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.shorts-carousel .swiper-wrapper {
    display: flex !important;
    align-items: stretch;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition-timing-function: ease-out !important;
}

.shorts-carousel .swiper-slide {
    width: 300px; /* Fixed width - not proportional */
    flex-shrink: 0;
}

/* Responsive slide widths - Show 4 full + 5th cut off */
@media (min-width: 1280px) {
    .shorts-carousel .swiper-slide {
        width: 320px; /* Fixed wider width */
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .shorts-carousel .swiper-slide {
        width: 300px; /* Fixed width */
    }
}

@media (max-width: 1023px) {
    .shorts-carousel .swiper-slide {
        width: 280px; /* Fixed width for tablets */
    }
}

/* ============================================
   NAVIGATION ARROWS (Desktop)
   ============================================ */

.shorts-carousel .swiper-button-next,
.shorts-carousel .swiper-button-prev {
    width: 44px !important;
    height: 44px !important;
    background: rgba(228, 0, 43, 0.9) !important; /* Red like Global News */
    border-radius: 4px; /* Square with rounded corners */
    color: #fff !important;
    transition: all 0.3s ease;
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1000 !important; /* Higher z-index than video cards */
    pointer-events: auto !important; /* Ensure clicks work */
    cursor: pointer !important;
    align-items: center;
    justify-content: center;
}

.shorts-carousel .swiper-button-next:hover,
.shorts-carousel .swiper-button-prev:hover {
    background: rgba(139, 0, 0, 1) !important; /* Dark red / red-black */
}

.shorts-carousel .swiper-button-next::after,
.shorts-carousel .swiper-button-prev::after {
    font-size: 20px;
    font-weight: bold;
}

/* Mobile: Hide arrows, show scrollbar, adjust slide count */
@media (max-width: 767px) {
    .shorts-carousel .swiper-button-next,
    .shorts-carousel .swiper-button-prev {
        display: none !important;
    }
    
    .shorts-carousel .swiper-slide {
        width: 60%; /* Show ~1.6 slides (first full, second partially visible) */
        max-width: 280px;
    }
    
    .infotel-featured-shorts {
        padding: 2rem 0 0 0; /* No side padding on mobile either to match desktop */
    }
}

/* Position arrows on absolute left/right edges */
.shorts-carousel .swiper-button-prev {
    left: 0 !important; /* Touch left edge */
    top: 50%;
    transform: translateY(-50%);
}

.shorts-carousel .swiper-button-next {
    right: 0 !important; /* Touch right edge */
    top: 50%;
    transform: translateY(-50%);
}

/* Section already styled above with padding for arrows */

/* Disabled state */
.shorts-carousel .swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ============================================
   SCROLLBAR (Mobile)
   ============================================ */

.swiper-scrollbar {
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    border-radius: 2px;
    margin-top: 16px; /* More space below slides */
    position: relative !important;
    bottom: 0 !important;
    z-index: 10; /* Ensure scrollbar is above slides */
    transition: none !important; /* Remove any transitions */
}

.swiper-scrollbar-drag {
    background: rgba(228, 0, 43, 0.8); /* Red to match theme */
    border-radius: 2px;
    transition: none !important; /* Remove drag animation */
}

/* Hide scrollbar on desktop */
@media (min-width: 768px) {
    .swiper-scrollbar {
        display: none !important;
    }
}

/* ============================================
   VIDEO CARD
   ============================================ */

.short-item {
    cursor: pointer;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.short-item:hover {
    transform: translateY(-5px);
}

/* ============================================
   9:16 ASPECT RATIO CONTAINER
   ============================================ */

.short-item__player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 175%; /* Increased height (taller videos) */
    background: #000;
    overflow: hidden;
}

/* ============================================
   THUMBNAIL
   ============================================ */

.short-item__thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Play Icon */
.short-item__play-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.short-item__play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
}

/* Branding */
.short-item__branding {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e4002b;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

/* Title Overlay (on video, at bottom) */
.short-item__title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.3;
    padding: 40px 12px 12px 12px; /* Extra padding at top for gradient */
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.95) 100%);
    transition: opacity 0.3s ease;
    z-index: 2;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide title on hover */
.short-item:hover .short-item__title-overlay {
    opacity: 0;
}

/* ============================================
   VIDEO PLAYER (HOVER PREVIEW)
   ============================================ */

.short-item__player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.short-item__player .plyr {
    width: 100%;
    height: 100%;
}

/* Hide Plyr controls for preview players */
.short-item__player .plyr__controls {
    display: none !important;
}

/* ============================================
   VIDEO TITLE (OLD - NOW USING OVERLAY)
   ============================================ */

/* Old title below video - no longer used */

/* ============================================
   MODAL (NATIVE DIALOG) - VERTICAL SWIPER
   ============================================ */

.shorts-modal {
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.85); /* Reduced from 0.95 to 0.85 (10% lighter) */
    width: 100vw;
    width: 100dvw; /* Dynamic viewport width for mobile */
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height - covers Safari navigation */
    min-height: 100vh;
    min-height: 100dvh;
    max-width: none;
    max-height: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    inset: 0; /* Cover entire viewport */
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 999999; /* Very high z-index to be above everything */
    -webkit-overflow-scrolling: touch;
}

/* Show modal when open */
.shorts-modal[open] {
    display: flex;
}

.shorts-modal::backdrop {
    background: rgba(0, 0, 0, 0.8); /* Reduced from 0.9 to 0.8 (10% lighter) */
    position: fixed;
    inset: 0; /* Cover entire viewport */
}

/* Vertical Swiper in Modal */
.shorts-modal__swiper {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.shorts-modal__swiper .swiper-wrapper {
    height: 100%;
}

.shorts-modal__slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 80px 20px 40px; /* Space for close button and title */
    box-sizing: border-box;
}

/* Old modal content - no longer used */
.shorts-modal__content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    width: 90%;
}

/* Close Button */
.shorts-modal__close {
    position: fixed; /* Fixed positioning to ensure visibility */
    top: 20px; /* Inside viewport, not outside */
    right: 20px;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    border: none;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 4px; /* Square with rounded corners like arrows */
    z-index: 99999; /* Much higher z-index */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    line-height: 1;
}

.shorts-modal__close:hover {
    background: rgba(0, 0, 0, 0.8) !important; /* Darker on hover */
}

/* Remove ALL focus outlines */
.shorts-modal__close:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.shorts-modal__close:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Modal Player Wrapper (9:16 Aspect Ratio) */
.shorts-modal__player-wrapper {
    position: relative;
    width: 90%;
    max-width: 450px; /* Max width for larger screens */
    height: auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 9 / 16; /* Modern aspect ratio */
    margin: 0 auto; /* Center horizontally */
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 9 / 16) {
    .shorts-modal__player-wrapper {
        padding-bottom: 177.77%; /* 9:16 aspect ratio fallback */
        height: 0;
    }
}

.shorts-modal__player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.shorts-modal__player .plyr {
    width: 100%;
    height: 100%;
}

/* Show Plyr controls in modal */
.shorts-modal__player .plyr__controls {
    display: flex !important;
}

/* Modal Title */
.shorts-modal__title {
    color: #fff;
    font-size: 1rem; /* Reduced from 1.1rem */
    text-align: center;
    margin: 1rem auto 0; /* Center horizontally with auto margins */
    padding: 0 1rem;
    max-width: 400px;
    width: 90%;
    line-height: 1.4;
}

/* Swipe Hint */
.shorts-modal__swipe-hint {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    text-align: center;
    margin: 0.5rem auto 0;
    padding: 8px 16px;
    max-width: 400px;
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.shorts-modal__swipe-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Swipe arrows icon */
.shorts-modal__swipe-hint::before {
    content: "⇅";
    font-size: 1.2rem;
    font-weight: bold;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (min-width: 768px) {
    .shorts-carousel .swiper-slide {
        width: 220px; /* Slightly larger on tablets */
    }

    .shorts-modal__content {
        max-width: 420px;
    }
}

@media (min-width: 1024px) {
    .shorts-carousel .swiper-slide {
        width: 240px; /* Even larger on desktop */
    }

    .shorts-modal__content {
        max-width: 450px;
    }
    
    /* Desktop modal video sizing */
    .shorts-modal__player-wrapper {
        max-width: 500px;
        width: 95%;
    }
    
    .shorts-modal__slide {
        padding: 100px 40px 60px; /* More padding on desktop */
    }
}

/* Mobile specific styles */
@media (max-width: 767px) {
    .shorts-carousel .swiper-slide {
        width: 200px; /* Smaller on mobile */
    }

    .short-item__title-overlay {
        font-size: 0.85rem;
        padding: 30px 10px 10px 10px;
    }

    .shorts-modal__content {
        max-width: 95%;
        width: 90%;
    }

    .shorts-modal__close {
        position: fixed;
        top: env(safe-area-inset-top, 20px); /* Respect notch on iPhone */
        right: 20px;
    }
    
    /* Ensure modal covers entire screen including Safari bar */
    .shorts-modal {
        padding-bottom: env(safe-area-inset-bottom, 0); /* Account for iOS home indicator */
    }
    
    .shorts-modal__player-wrapper {
        max-height: 70vh; /* Limit video height to 70% of viewport */
        width: auto;
        max-width: 100%;
    }
    
    /* Adjust slide padding on mobile for better spacing */
    .shorts-modal__slide {
        padding: 60px 15px 30px; /* Reduced padding */
        justify-content: flex-start; /* Align to top instead of center */
        gap: 10px; /* Add gap between elements */
    }
    
    /* Smaller title on mobile to prevent cutting off swipe hint */
    .shorts-modal__title {
        font-size: 0.85rem; /* Reduced from 1rem */
        line-height: 1.3;
        margin-top: 0.5rem;
        padding: 0 0.75rem;
    }
    
    /* Ensure swipe hint is visible */
    .shorts-modal__swipe-hint {
        font-size: 0.8rem; /* Slightly smaller on mobile */
        margin-top: 0.3rem;
        margin-bottom: 0.5rem; /* Add bottom margin for safe area */
    }
}

/* ============================================
   UNMUTE PROMPT (iOS)
   ============================================ */
.shorts-modal__unmute-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 20px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

