/* Prevent background scroll when modal is open */
body.modal-is-open {
    overflow: hidden;
}

/* Fullscreen modal container */
#card-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

/* Iframe container within the modal */
.modal-iframe-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #111; /* Fallback color while iframe loads */
}

.modal-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff; /* White background for projects */
}

/* Close button for the modal */
.modal-close-btn {
    position: fixed;
    top: 20px;
    right: 25px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    line-height: 38px;
    text-align: center;
    cursor: pointer;
    z-index: 2020; /* Highest z-index */
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.modal-close-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 0, 0, 0.7);
}

/* START OF CHANGE: New styles for navigation and index */

/* Common style for both navigation buttons */
.modal-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 28px;
    font-weight: 300;
    line-height: 42px;
    text-align: center;
    cursor: pointer;
    z-index: 2010; /* Below close button, above iframe */
    transition: transform 0.2s ease, background-color 0.2s ease;
    user-select: none;
}
.modal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.05);
}

/* Individual position for prev/next buttons */
.modal-nav-btn.prev {
    left: 25px;
}
.modal-nav-btn.next {
    right: 25px;
}

/* Style for the index counter at the bottom */
.modal-index-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    font-weight: 600;
    z-index: 2010;
    pointer-events: none; /* Make it non-interactive */
}
/* END OF CHANGE */