/* Full-Screen Overlay Styling */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98); /* Slightly transparent white */
    background-image: url("../img/pattern.png");
    z-index: 10001; /* Above everything including nav */
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1); /* Starts slightly zoomed for a "morphing" feel */
    transition: all 0.5s cubic-bezier(0.7, 0, 0.3, 1);
    overflow-y: auto;
    padding: 80px 0;
}

.fullscreen-overlay.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Close Button */
.overlay-close {
    position: fixed;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    font-size: 40px;
    color: #333;
    cursor: pointer;
    z-index: 10002;
    transition: transform 0.3s ease;
}

.overlay-close:hover {
    transform: rotate(90deg);
    color: #00a8ff;
}

/* Content Styling */
.overlay-title {
    font-weight: 700;
    margin-bottom: 50px;
    color: #1a2a3a;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.overlay-content {
    font-size: 18px;
    line-height: 2;
    color: #555;
}

.overlay-content h3 {
    margin-top: 40px;
    color: var('--secondary-colour');
}

/* Prevent scrolling when overlay is open */
body.overlay-open {
    overflow: hidden;
}

/* --- Responsiveness for Full-Screen Overlay --- */

/* Tablets (Portrait) and below */
@media (max-width: 991px) {
    .fullscreen-overlay {
        padding: 60px 0; /* Slightly less top/bottom padding */
    }

    .overlay-title {
        font-size: 22px; /* Scaled down from default */
        margin-bottom: 30px;
    }

    .overlay-content {
        font-size: 14px; /* Better reading size for tablets */
        line-height: 1.6;
    }
}

/* Mobile Devices */
@media (max-width: 767px) {
    .fullscreen-overlay {
        padding: 50px 15px; /* Add horizontal padding so text doesn't touch edges */
        background: #fff; /* Solid white often looks cleaner on mobile than 0.98 alpha */
        background-image: url("../img/pattern.png");

    }

    /* Adjust the Close Button for Mobile */
    .overlay-close {
        top: 15px;
        right: 15px;
        font-size: 32px; /* Slightly smaller but still very tappable */
        background: rgba(255, 255, 255, 0.9); /* Ensure it's visible over content */
        border-radius: 50%;
        width: 44px;
        height: 44px;
        line-height: 44px;
        text-align: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .overlay-title {
        font-size: 20px;
        text-align: center;
        margin-top: 20px; /* Space for the floating X button */
    }

    .overlay-content h3 {
        font-size: 18px;
        margin-top: 25px;
    }
    .overlay-content p {
        font-size: 14px;
        margin-top: 15px;
    }
    /* Make the bottom button full-width on mobile for easier "Accept" action */
    #close-privacy-btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
}

/* Landscape orientation on small phones (fix for short vertical height) */
@media (max-height: 450px) {
    .fullscreen-overlay {
        padding-top: 40px;
    }
    .overlay-close {
        top: 10px;
    }
}
