/* Modal Styles */
#videoModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999; /* Ensure it's on top */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#videoModal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#videoModal.show .modal-content {
    transform: scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.15); /* improved visibility */
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    z-index: 10000; /* Higher than modal content */
    transition: all 0.3s ease;
}

[dir="rtl"] .close-modal-btn {
    right: auto;
    left: 25px;
}

.close-modal-btn:hover {
    color: #b9ff66; /* Lime green */
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Hotfix: Prevent single project card from stretching too wide */
.project-card {
    max-width: 500px !important;
    width: 100%;
    margin: 0 auto;
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 80vh;
}
