/* immersive_switch_member_modal_V0.01.css — Custom confirm for admin “Switch to Member” */

/* ── 1. 基礎樣式 ─────────────────────────────────────────────────────────── */
.kms-switch-member-modal {
    position: fixed;
    inset: 0;
    z-index: 100020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    -webkit-tap-highlight-color: transparent;
}

.kms-switch-member-modal.kms-switch-member-modal--open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.kms-switch-member-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 22, 0.72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.kms-switch-member-modal__panel {
    position: relative;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    border-radius: 20px;
    padding: 28px 26px 24px;
    color: #e8ecf4;
    background: linear-gradient(155deg, rgba(36, 42, 58, 0.98), rgba(18, 22, 34, 0.99));
    border: 1px solid rgba(120, 160, 220, 0.22);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: scale(0.94) translateY(12px);
    transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.kms-switch-member-modal--open .kms-switch-member-modal__panel {
    transform: scale(1) translateY(0);
}

.kms-switch-member-modal__glow {
    position: absolute;
    top: -40%;
    left: 50%;
    width: 120%;
    height: 80%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(99, 140, 255, 0.18), transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

.kms-switch-member-modal__icon {
    position: relative;
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(80, 110, 200, 0.35), rgba(40, 55, 100, 0.5));
    border: 1px solid rgba(140, 170, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.kms-switch-member-modal__title {
    position: relative;
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    color: #f0f4fc;
}

.kms-switch-member-modal__username {
    display: block;
    margin-top: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #a8c4ff;
    word-break: break-all;
}

.kms-switch-member-modal__message {
    position: relative;
    margin: 0 0 22px;
    font-size: 0.875rem;
    line-height: 1.55;
    text-align: center;
    color: rgba(210, 218, 235, 0.82);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.kms-switch-member-modal__actions {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: center;
}

/* OK 僅在錯誤提示模式顯示；確認模式只有 Cancel + Switch now */
#kmsSwitchMemberModalOk.kms-switch-member-modal__btn--alert-only {
    display: none;
}

.kms-switch-member-modal--alert #kmsSwitchMemberModalCancel,
.kms-switch-member-modal--alert #kmsSwitchMemberModalConfirm {
    display: none !important;
}

.kms-switch-member-modal--alert #kmsSwitchMemberModalOk.kms-switch-member-modal__btn--alert-only {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 100%;
}

.kms-switch-member-modal__btn {
    flex: 1 1 calc(50% - 5px);
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.kms-switch-member-modal__btn:active {
    transform: scale(0.98);
}

.kms-switch-member-modal__btn--ghost {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #c8d0e4;
}

.kms-switch-member-modal__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

.kms-switch-member-modal__btn--primary {
    background: linear-gradient(145deg, #4a6fff, #2d4acb);
    border-color: rgba(120, 160, 255, 0.45);
    color: #f4f7ff;
    box-shadow: 0 6px 20px rgba(45, 74, 203, 0.45);
}

.kms-switch-member-modal__btn--primary:hover {
    filter: brightness(1.06);
}

.kms-switch-member-modal__btn--primary:disabled {
    opacity: 0.55;
    cursor: wait;
    pointer-events: none;
}

.kms-switch-member-modal--alert .kms-switch-member-modal__icon {
    background: linear-gradient(145deg, rgba(200, 90, 90, 0.35), rgba(90, 35, 40, 0.5));
    border-color: rgba(255, 140, 140, 0.25);
}

/* ── 2. 布局樣式 ─────────────────────────────────────────────────────────── */
.kms-switch-member-modal__panel {
    overflow: hidden;
    max-height: min(90vh, 520px);
}

/* ── 3. 交互樣式 ─────────────────────────────────────────────────────────── */
.kms-switch-member-modal__backdrop {
    cursor: pointer;
}

.kms-switch-member-modal__panel {
    cursor: default;
}

/* ── 4. 響應式樣式（觸控、無捲動條） ─────────────────────────────────────── */
@media screen and (max-width: 768px) {
    .kms-switch-member-modal__panel {
        max-width: none;
        border-radius: 18px;
        padding: 22px 18px 18px;
        max-height: min(88vh, 480px);
        overflow: hidden;
    }

    .kms-switch-member-modal__title {
        font-size: 1.05rem;
    }

    .kms-switch-member-modal:not(.kms-switch-member-modal--alert) .kms-switch-member-modal__actions .kms-switch-member-modal__btn:not(.kms-switch-member-modal__btn--alert-only) {
        min-height: 48px;
        flex: 1 1 0;
        min-width: 0;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .kms-switch-member-modal,
    .kms-switch-member-modal__panel,
    .kms-switch-member-modal__btn {
        transition: none;
    }

    .kms-switch-member-modal--open .kms-switch-member-modal__panel {
        transform: none;
    }
}
