.video-showcase {
    padding: 140px 0;
    background: 
        url('../images/img1.jpg') center/cover no-repeat,
        linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(102, 126, 234, 0.05) 25%, rgba(240, 147, 251, 0.05) 75%, rgba(248, 250, 252, 0.95) 100%);
    background-blend-mode: overlay;
    overflow: hidden;
    position: relative;
}

.video-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(102, 126, 234, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 75% 75%, rgba(240, 147, 251, 0.06) 0%, transparent 60%);
    animation: videoOverlayFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes videoOverlayFloat {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 0 20px;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 15px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    /* Fix arrow placement */
    left: unset;
    right: unset;
}

.carousel-arrow.left {
    left: -30px;
    right: auto;
}

.carousel-arrow.right {
    right: -30px;
    left: auto;
}

.carousel-arrow:hover {
    background: var(--primary-gradient);
    transform: translateY(-50%) scale(1.15);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.carousel-arrow:hover i {
    color: white;
}

.carousel-arrow i {
    color: #667eea;
    font-size: 20px;
    transition: var(--transition);
}

.video-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.video-carousel::-webkit-scrollbar {
    display: none;
}

.video-item {
    position: relative;
    flex: 0 0 auto;
    width: 300px;
    height: 520px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(102, 126, 234, 0.08);
    box-shadow: var(--shadow);
}

.video-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-large);
    border-color: rgba(102, 126, 234, 0.2);
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
    transition: var(--transition);
}

.play-pause-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 5;
    opacity: 1;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.play-pause-btn:hover {
    background: var(--primary-gradient);
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.play-pause-btn:hover i {
    color: white;
}

.play-pause-btn i {
    color: #667eea;
    font-size: 22px;
    transition: var(--transition);
}

.play-pause-btn.play i {
    margin-left: 3px;
}

/* Hide play button when video is playing */
.video-item.playing .play-pause-btn {
    opacity: 0;
    pointer-events: none;
}

/* Show controls on hover when playing */
.video-item.playing:hover .play-pause-btn {
    opacity: 1;
    pointer-events: auto;
}

.video-item.playing:hover .play-pause-btn i::before {
    content: "\f04c"; /* pause icon */
}

/* Auto-play indicator */
.video-item.auto-playing {
    border: 3px solid #667eea;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
    animation: autoPlayGlow 2s ease-in-out infinite;
}

@keyframes autoPlayGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.7);
    }
}

/* Pause videos when not in viewport */
.video-showcase:not(.in-viewport) .video-item video {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .carousel-arrow {
        display: none;
    }
    
    .video-item {
        width: 250px;
        height: 400px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .carousel-container {
        padding: 0 15px;
    }
    
    .video-carousel {
        gap: 15px;
    }
}

@media (max-width: 900px) {
    .video-item {
        width: 220px;
        height: 360px;
    }
}

@media (max-width: 600px) {
    .video-item {
        width: 95vw;
        max-width: 340px;
        height: 62vw;
        max-height: 270px;
        min-width: 300px;
        min-height:500px;
        margin: 0 auto;
    }
    .carousel-arrow {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

.video-info {
    text-align: left;
    padding: 10px 5px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.video-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.video-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Larger text for the big video */
.video-card:nth-child(4) .video-title {
    font-size: 1.3rem;
}

.video-card:nth-child(4) .video-description {
    font-size: 0.95rem;
    -webkit-line-clamp: 3;
}

.video-stats {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    margin-top: 8px;
}

.video-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.video-stat i {
    color: #667eea;
}

@keyframes videoOverlay {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(10px, -10px) rotate(1deg);
        opacity: 0.8;
    }
}

@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 250px);
    }
    
    .video-card:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }
    
    .video-card:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }
    
    .video-card:nth-child(3) {
        grid-column: 1;
        grid-row: 2;
    }
    
    .video-card:nth-child(4) {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (max-width: 768px) {
    .video-card {
        width: 250px;
        height: 350px;
    }
    
    .video-container {
        height: 65% !important;
    }
    
    .video-showcase .section-title {
        font-size: 2rem;
    }
    
    .video-horizontal-scroll {
        padding: 0 15px;
        gap: 15px;
    }
}
