/*
* Helios Clinic Kuwait - Modern Video Gallery Styles
* Version: 1.1.0 - Enhanced for all device types
*/

/* Video Gallery Section Styles
=================================================================== */
.video-gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px auto;
    width: 100%;
    max-width: 1200px;
    padding: 0 15px;
    box-sizing: border-box;
}

.video-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 16/9;
    cursor: pointer;
    min-height: 200px;
    display: block;
    width: 100%;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    z-index: 1;
    display: block;
}

.video-card.playing .video-thumbnail {
    opacity: 0;
    pointer-events: none;
}

.video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    display: block;
}

.video-card.playing .video-element {
    z-index: 2;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
}

.play-icon i {
    color: white;
    font-size: 30px;
    transition: transform 0.3s ease;
}

.video-card:hover .play-icon {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-card.playing .play-icon {
    opacity: 0;
    pointer-events: none;
}

.video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    font-size: 16px;
    font-weight: 500;
    z-index: 3;
    transition: transform 0.3s ease;
}

.video-card:hover .video-title {
    transform: translateY(-5px);
}

.video-card.playing .video-title {
    opacity: 0;
    pointer-events: none;
}

.pause-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.pause-icon i {
    color: white;
    font-size: 18px;
}

.video-card.playing:hover .pause-icon {
    opacity: 1;
}

/* Video Controls */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    align-items: center;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card.playing:hover .video-controls {
    opacity: 1;
}

.progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 10px;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    background-color: #fff;
    border-radius: 2px;
    width: 0;
    transition: width 0.1s linear;
}

.volume-control {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.volume-icon {
    color: white;
    font-size: 16px;
    margin-right: 8px;
    cursor: pointer;
}

.volume-slider {
    width: 60px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-level {
    height: 100%;
    background-color: #fff;
    border-radius: 2px;
    width: 100%;
}

/* Fullscreen button */
.fullscreen-icon {
    color: white;
    font-size: 16px;
    margin-left: 10px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.fullscreen-icon:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Video interaction overlay for autoplay restrictions */
.video-interaction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 16px;
    cursor: pointer;
    animation: pulse 1.5s infinite;
}

.video-interaction-overlay div {
    text-align: center;
    color: white;
}

.video-interaction-overlay i {
    font-size: 40px;
    margin-bottom: 10px;
}

.video-interaction-overlay p {
    font-size: 16px;
    margin: 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Fullscreen video styles */
.video-element:fullscreen {
    object-fit: contain;
    background-color: black;
}

/* Double-tap hint for mobile devices */
.touch-device .video-card.playing::after {
    content: "Double-tap for fullscreen";
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0.8;
    pointer-events: none;
    z-index: 6;
    animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
    0% { opacity: 0.8; }
    70% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Responsive Styles for All Device Types
=================================================================== */

/* Large Desktop Screens (1440px and above) */
@media (min-width: 1440px) {
    .video-gallery-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
        max-width: 1400px;
        margin: 50px auto;
        padding: 0 30px;
    }
    
    .video-card {
        aspect-ratio: 16/9;
        min-height: 220px;
    }
    
    .play-icon {
        width: 80px;
        height: 80px;
    }
    
    .play-icon i {
        font-size: 34px;
    }
    
    .video-title {
        font-size: 18px;
        padding: 18px 24px;
    }
}

/* Desktop Screens (1200px to 1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .video-gallery-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
        max-width: 1140px;
        margin: 40px auto;
        padding: 0 20px;
    }
    
    .video-card {
        min-height: 210px;
    }
}

/* Small Desktop and Large Tablets (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .video-gallery-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        max-width: 960px;
        margin: 40px auto;
        padding: 0 15px;
    }
    
    .video-card {
        min-height: 200px;
    }
    
    .play-icon {
        width: 70px;
        height: 70px;
    }
}

/* Tablets (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .video-gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 720px;
        margin: 30px auto;
        padding: 0 15px;
    }
    
    .video-card {
        min-height: 200px;
    }
    
    .play-icon {
        width: 65px;
        height: 65px;
    }
    
    .play-icon i {
        font-size: 28px;
    }
    
    .video-title {
        padding: 15px 18px;
        font-size: 16px;
    }
    
    .pause-icon {
        width: 36px;
        height: 36px;
    }
}

/* Large Mobile Devices (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .video-gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin: 30px auto;
        max-width: 540px;
        padding: 0 15px;
    }
    
    .video-card {
        aspect-ratio: 16/9;
        min-height: 180px;
    }
    
    .play-icon {
        width: 60px;
        height: 60px;
    }
    
    .play-icon i {
        font-size: 24px;
    }
    
    .video-title {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .pause-icon {
        width: 32px;
        height: 32px;
        top: 10px;
        right: 10px;
    }
    
    .pause-icon i {
        font-size: 16px;
    }
    
    .video-controls {
        padding: 10px;
    }
    
    .progress-bar {
        height: 3px;
    }
    
    .volume-slider {
        width: 40px;
    }
    
    .fullscreen-icon {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
}

/* Small Mobile Devices (575px and below) */
@media (max-width: 575px) {
    .video-gallery-container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px auto;
        width: 100%;
        max-width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }
    
    .video-card {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        aspect-ratio: 16/9;
        min-height: 200px;
    }
    
    .play-icon {
        width: 55px;
        height: 55px;
    }
    
    .play-icon i {
        font-size: 22px;
    }
    
    .video-title {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .pause-icon {
        width: 30px;
        height: 30px;
        top: 8px;
        right: 8px;
    }
    
    .pause-icon i {
        font-size: 14px;
    }
    
    .video-controls {
        padding: 8px;
    }
    
    .progress-bar {
        height: 3px;
        margin: 0 5px;
    }
    
    .volume-control {
        margin-left: 5px;
    }
    
    .volume-slider {
        width: 30px;
        height: 3px;
    }
    
    .fullscreen-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
        margin-left: 5px;
    }
}

/* Extra Small Mobile Devices (320px and below) */
@media (max-width: 320px) {
    .video-gallery-container {
        gap: 15px;
        padding: 0 5px;
    }
    
    .video-card {
        min-height: 180px;
    }
    
    .play-icon {
        width: 50px;
        height: 50px;
    }
    
    .play-icon i {
        font-size: 20px;
    }
    
    .video-title {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .video-controls {
        padding: 6px;
    }
    
    /* Hide volume slider on very small screens to save space */
    .volume-slider {
        display: none;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    /* Make controls always visible on touch devices */
    .video-card.playing .video-controls {
        opacity: 1;
    }
    
    .video-card.playing .pause-icon {
        opacity: 1;
    }
    
    /* Increase tap target sizes for touch devices */
    .pause-icon, 
    .volume-icon {
        min-width: 36px;
        min-height: 36px;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    .volume-slider {
        height: 6px;
    }
    
    /* Fix for mobile devices */
    .video-card {
        display: block;
        height: auto;
        min-height: 200px;
    }
    
    .video-thumbnail,
    .video-element {
        position: absolute;
        width: 100%;
        height: 100%;
    }
    
    /* Ensure play button is visible */
    .play-icon {
        z-index: 5;
        background-color: rgba(0, 0, 0, 0.4);
    }
}