/**
 * Popup/Modal Styles
 * RSNVIP9 - Dark mode with gold accents
 *
 * Uses CSS variables from user-ui.css for consistency:
 * --theme-surface (card background)
 * --theme-text (text color)
 * --theme-text-muted (muted text)
 * --theme-accent (gold accent)
 * --theme-primary (blue accent)
 * --theme-z-overlay (z-index)
 */

/* Backdrop overlay */
.popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--theme-z-overlay, 2000);
    background: rgb(0 7 18 / 72%);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(5px);
    transition: opacity 180ms ease, visibility 180ms ease;
}

.popup-backdrop.show {
    opacity: 1;
    visibility: visible;
}

body.popup-open {
    overflow: hidden;
}

/* Popup container */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: calc(var(--theme-z-overlay, 2000) + 1);
    display: flex;
    width: min(calc(100vw - 32px), 424px);
    max-height: min(82svh, 720px);
    flex-direction: column;
    overflow: hidden;
    color: var(--theme-text, #FFF8E6);
    background: var(--theme-surface, #18212B);
    border: 1px solid var(--theme-border, rgb(245 199 92 / 34%));
    border-radius: var(--theme-radius, 18px);
    box-shadow: var(--theme-shadow, 0 18px 42px rgb(0 6 20 / 35%));
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -46%);
    transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.popup.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

/* Header */
.popup-header {
    padding: 22px 54px 10px;
    text-align: center;
}

.popup-header h2 {
    margin: 0;
    color: var(--theme-text, #FFF8E6);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.popup-header p {
    margin: 7px 0 0;
    color: var(--theme-text-muted, #AFA38B);
    font-size: 14px;
    line-height: 1.45;
}

/* Content area */
.popup-content {
    flex-grow: 1;
    padding: 12px 18px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.popup-detail,
.popup-note {
    margin: 0;
    color: var(--theme-text-muted, #AFA38B);
    font-size: 14px;
    line-height: 1.55;
}

.popup-note {
    margin-top: 14px;
    font-size: 13px;
}

/* Rules/list items */
.popup-rule {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 13px 0;
    color: var(--theme-text, #FFF8E6);
    border-bottom: 1px solid var(--theme-border-soft, rgb(255 229 154 / 15%));
    font-size: 14px;
}

.popup-rule strong,
.deposit-header strong,
.bonus {
    color: var(--theme-accent, #F5C75C);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Deposit options */
.deposit-option {
    padding: 14px 0;
    border-bottom: 1px solid var(--theme-border-soft, rgb(255 229 154 / 15%));
}

.deposit-header {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 5px;
    color: var(--theme-text, #FFF8E6);
    font-size: 16px;
}

/* Progress bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.progress-bar {
    position: relative;
    min-width: 0;
    height: 20px;
    flex: 1;
    overflow: hidden;
    background: var(--theme-canvas-raised, #10151B);
    border: 1px solid var(--theme-border-soft, rgb(255 229 154 / 15%));
    border-radius: 999px;
}

.progress-text {
    position: absolute;
    z-index: 1;
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: var(--theme-text, #FFF8E6);
    font-size: 12px;
}

.progress {
    width: 0;
    height: 100%;
    background: var(--theme-primary, #18C7B6);
    border-radius: inherit;
}

/* Action buttons */
.deposit-button,
.activity-button {
    min-height: 44px;
    padding: 0 18px;
    color: #15150d;
    background: var(--theme-accent, #F5C75C);
    border: 1px solid var(--theme-accent-strong, #FFE59A);
    border-radius: 12px;
    box-shadow: 0 10px 22px rgb(245 196 81 / 16%);
    cursor: pointer;
    font-weight: 800;
}

.deposit-button:hover,
.activity-button:hover {
    background: var(--theme-accent-strong, #FFE59A);
}

/* Footer */
.popup-footer {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--theme-border-soft, rgb(255 229 154 / 15%));
}

.reminder-button {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    color: var(--theme-text-muted, #AFA38B);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-weight: 650;
    text-align: left;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--theme-text-muted, #AFA38B);
    background: rgb(159 180 205 / 10%);
    border: 1px solid var(--theme-border-soft, rgb(255 229 154 / 15%));
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.popup :is(button, a):focus-visible {
    outline: 2px solid var(--theme-accent, #F5C75C);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 340px) {
    .popup {
        width: calc(100vw - 24px);
    }

    .popup-header {
        padding-inline: 48px;
    }

    .popup-header h2 {
        font-size: 18px;
    }

    .popup-footer {
        gap: 8px;
        padding-inline: 12px;
    }

    .activity-button {
        padding-inline: 12px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .popup,
    .popup-backdrop {
        transition: none;
    }
}
