.videos {
    padding: 7rem 2rem;
    background: transparent;
    position: relative;
    z-index: 1;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-top: 5rem;
}

.video-item {
    position: relative;
    overflow: hidden;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.18);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    display: flex;
    flex-direction: column;
}

.video-item:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    z-index: 10;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 25px 25px 0 0;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-item:hover .video-thumbnail img {
    transform: scale(1.1);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(117, 59, 125, 0.5);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.play-button svg {
    width: 40px;
    height: 40px;
    margin-left: 5px;
}

.video-item:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 15px 40px rgba(117, 59, 125, 0.7);
}

.video-item h3 {
    padding: 1.5rem;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

/* Video Popup Modal */
.video-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.video-popup.active {
    display: flex;
}

.video-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.video-popup-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    z-index: 10001;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.video-popup-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10002;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.video-popup-close:hover {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.1);
}

.video-popup-iframe-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.video-popup-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-popup-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--white);
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 15px;
    z-index: 10;
}

.video-popup-fallback p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.video-popup-fallback a {
    color: var(--white);
    text-decoration: underline;
    font-weight: 700;
    transition: color 0.3s;
}

.video-popup-fallback a:hover {
    color: var(--primary);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 2rem;
    }

    .video-item {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .videos {
        padding: 4rem 1rem;
    }

    .videos-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 1.5rem;
        margin-top: 3rem;
    }

    .video-item {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
}
