/* ===== Modal Overlay ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgb(0 0 0 / 80%);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    overflow-y: auto;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background-color: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: var(--z-modal);
    animation: modalFadeIn var(--transition-slow);
}

/* ===== Scroll Fade Indicators ===== */

/* Shows user there's more content above/below */

/* Top fade (appears when scrolled down) */
.modal-content::before {
    content: '';
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, var(--color-white), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 10;
}

.modal-content.is-scrolled::before {
    opacity: 1;
}

/* Bottom fade (appears when there's more content below) */
.modal-content::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, var(--color-white), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 10;
}

.modal-content.has-more-content::after {
    opacity: 1;
}

/* Card detail modal: cream scroll fades instead of white */
.modal-content.card-detail::before {
    background: linear-gradient(to bottom, var(--color-cream), transparent);
}

.modal-content.card-detail::after {
    background: linear-gradient(to top, var(--color-cream), transparent);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    z-index: var(--z-modal-backdrop);
}

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: rgb(0 0 0 / 10%);
    border: 2px solid rgb(0 0 0 / 20%);
    font-size: var(--text-4xl);
    color: var(--color-gray-900);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    line-height: 1;
    z-index: var(--z-modal);
    font-weight: 300;
    -webkit-tap-highlight-color: transparent;
}

.modal-close:hover {
    background-color: rgb(0 0 0 / 20%);
    border-color: rgb(0 0 0 / 30%);
    transform: scale(1.05);
}

.modal-close:active {
    transform: scale(0.95);
}

/* ===== Entry Gate Modal - Higher z-index to appear above payment modal ===== */
.entry-gate-modal {
    z-index: var(--z-modal-above) !important;
}

.entry-gate {
    width: 600px;
    padding: var(--space-12);
}

.modal-header {
    margin-bottom: var(--space-8);
}

.logo-title {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.logo-icon {
    font-size: var(--text-4xl);
    line-height: 1;
}

.modal-header h2 {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--color-navy);
    line-height: var(--leading-tight);
}

.subtitle {
    font-size: var(--text-lg);
    color: var(--color-gray-700);
    line-height: var(--leading-relaxed);
}

/* Detail image - display only, no zoom */
.card-detail-image {
    cursor: default;
}
