/* =========================================================
   FILE: css/modal.css
   Premium Futuristic Modal Viewer
========================================================= */

/* ================================
   Modal Overlay
================================ */

.modal-overlay {

    position: fixed;
    inset: 0;

    width: 100%;
    height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background:
        radial-gradient(
            circle at top,
            rgba(91, 140, 255, 0.15),
            transparent 40%
        ),
        rgba(0, 0, 0, 0.78);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    z-index: 999999;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
}

/* ================================
   Active Modal State
================================ */

.modal-overlay.active {

    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}

/* ================================
   Modal Content Wrapper
================================ */

.modal-content {

    position: relative;

    width: 100%;
    max-width: 1200px;

    border-radius: 28px;

    overflow: hidden;

    background:
        rgba(15, 15, 22, 0.88);

    border:
        1px solid rgba(91, 140, 255, 0.18);

    box-shadow:
        0 0 40px rgba(91, 140, 255, 0.18),
        0 0 120px rgba(91, 140, 255, 0.08);

    transform:
        translateY(40px)
        scale(0.94);

    transition:
        transform 0.4s ease,
        opacity 0.4s ease;

    opacity: 0;
}

/* ================================
   Active Animation
================================ */

.modal-overlay.active .modal-content {

    opacity: 1;

    transform:
        translateY(0)
        scale(1);
}

/* ================================
   Preview Image
================================ */

.modal-image {

    width: 100%;
    height: auto;

    max-height: 88vh;

    object-fit: contain;

    display: block;

    background: #0f1117;

    transition:
        transform 0.6s ease,
        filter 0.4s ease;
}

/* ================================
   Hover Zoom Effect
================================ */

.modal-content:hover .modal-image {

    transform: scale(1.015);

    filter:
        brightness(1.03)
        contrast(1.03);
}

/* ================================
   Close Button
================================ */

.close-btn {

    position: absolute;

    top: 18px;
    right: 18px;

    width: 48px;
    height: 48px;

    border: none;
    outline: none;

    border-radius: 50%;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;
    font-weight: 700;

    color: #ffffff;

    background:
        rgba(255, 255, 255, 0.08);

    border:
        1px solid rgba(255, 255, 255, 0.1);

    backdrop-filter: blur(10px);

    z-index: 10;

    transition:
        transform 0.3s ease,
        background 0.3s ease,
        box-shadow 0.3s ease;
}

/* ================================
   Close Hover
================================ */

.close-btn:hover {

    transform: scale(1.08);

    background:
        rgba(91, 140, 255, 0.18);

    box-shadow:
        0 0 20px rgba(91, 140, 255, 0.35);
}

/* ================================
   Optional Caption
================================ */

.modal-caption {

    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;

    padding: 18px 24px;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.75),
            transparent
        );

    color:
        rgba(255, 255, 255, 0.9);

    font-size: 15px;
    font-weight: 500;

    letter-spacing: 0.4px;
}

/* ================================
   Hide Scrollbar
================================ */

.modal-overlay::-webkit-scrollbar {

    display: none;
}

/* ================================
   Tablet Responsive
================================ */

@media (max-width: 768px) {

    .modal-overlay {

        padding: 16px;
    }

    .modal-content {

        border-radius: 20px;
    }

    .modal-image {

        max-height: 75vh;
    }

    .close-btn {

        width: 42px;
        height: 42px;

        top: 12px;
        right: 12px;

        font-size: 16px;
    }

    .modal-caption {

        padding: 14px 18px;

        font-size: 14px;
    }
}

/* ================================
   Small Mobile Responsive
================================ */

@media (max-width: 480px) {

    .modal-overlay {

        padding: 10px;
    }

    .modal-content {

        border-radius: 18px;
    }

    .modal-image {

        max-height: 70vh;
    }

    .close-btn {

        width: 38px;
        height: 38px;

        font-size: 14px;
    }
}
