/* Video modal styles */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    /* Use flexbox for centering */
    justify-content: center;
    align-items: center;
    /* Add opacity animation for background */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Animation for modal appearance */
.video-modal.show {
    opacity: 1;
}

.video-modal .modal-content {
    position: relative;
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    /* Add transform for animation */
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

/* Animation class for modal content */
.video-modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.video-modal .close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
    /* Make close button more visible */
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal .close-button:hover {
    color: #888;
    background-color: rgba(0, 0, 0, 0.7);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-top: 30px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Modal open body style */
body.modal-open {
    overflow: hidden;
}

/* Media queries for responsive modal */
@media (max-width: 768px) {
    .video-modal .modal-content {
        width: 95%;
        padding: 15px;
    }

    .video-container {
        margin-top: 35px;
    }

    .video-modal .close-button {
        top: 5px;
        right: 5px;
        /* Larger touch target for mobile */
        width: 44px;
        height: 44px;
    }
}

/* Touch device enhancements */
@media (hover: none) {
    .video-modal .close-button {
        /* Make close button bigger for touch devices */
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
}