/* =================================================
   STYLES FOR THE MEDIA POPUP (MODAL)
   ================================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex; /* Use flexbox for easy centering */
    align-items: center;
    justify-content: center;
    
    /* Hide by default */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* The class that makes the modal visible */
.modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.modal-content {
    position: relative;
    z-index: 1001;
    background-color: #1a1a1a;
    border-radius: 8px;
    /* Make it large for media */
    width: 80vw;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-close-btn {
    position: absolute;
    top: -40px; /* Position it outside, above the modal */
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}
.modal-close-btn:hover {
    transform: scale(1.1);
}

.modal-body {
    flex-grow: 1; /* Make the body fill all available space */
}

/* Ensure iframe and video fill the modal body */
.modal-body iframe,
.modal-body video {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- BUTTONS to trigger the modals --- */
.media-buttons-container {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.media-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 10px 20px;
    background-color: #333;
    border: 1px solid #555;
    color: #ddd;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.media-btn:hover {
    background-color: #444;
    border-color: #777;
    transform: translateY(-2px);
}