/**
 * LoliMeow Theme - 弹窗统一基础样式
 * 所有弹窗组件共用的基础样式和动画
 * 
 * @package LoliMeow
 * @version 8.01
 * @since 2026-03-05
 * 
 * 命名规范：
 * - 遮罩层：.dialog-overlay
 * - 弹窗容器：.dialog-modal
 * - 弹窗内容：.dialog-content
 * - 关闭按钮：.dialog-close
 * - 弹窗头部：.dialog-header
 * - 弹窗主体：.dialog-body
 * - 弹窗底部：.dialog-footer
 */

/* ========================================
   弹窗统一基础样式
   ======================================== */

/* 遮罩层 */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dialog-overlay.active {
    opacity: 1;
}

/* 弹窗容器 */
.dialog-modal {
    background: var(--bg-secondary, #1a2332);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.dialog-overlay.active .dialog-modal {
    transform: translateY(0);
}

/* 弹窗内容 */
.dialog-content {
    padding: 24px;
}

/* 关闭按钮 - 统一样式 */
.dialog-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary, #1f2937);
    border: 1px solid var(--border-primary, #2a3442);
    border-radius: 8px;
    color: var(--text-tertiary, #b0b0b0);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.dialog-close:hover {
    background: var(--bg-darker, #0d1117);
    border-color: var(--theme-primary, #35EB90);
    color: var(--theme-primary, #35EB90);
    transform: rotate(90deg);
}

.dialog-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* 弹窗头部 */
.dialog-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-primary, #2a3442);
}

.dialog-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #f0f0f0);
}

/* 弹窗主体 */
.dialog-body {
    padding: 24px;
}

/* 弹窗底部 */
.dialog-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}


/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(30px);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dialog-modal {
        width: 95%;
        max-width: none;
    }

    .dialog-content {
        padding: 20px;
    }

    .dialog-header {
        padding: 20px 20px 12px;
    }

    .dialog-body {
        padding: 20px;
    }

    .dialog-footer {
        padding: 12px 20px 20px;
        flex-direction: column;
    }

    .dialog-footer .lm-btn {
        width: 100%;
    }
}

/* 防止页面滚动 */
body.dialog-open {
    overflow: hidden;
}

/* ========================================
   兼容旧类名（向后兼容）
   ======================================== */

/* boxmoe-popup 系列 */
.boxmoe-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.boxmoe-popup-overlay.active {
    opacity: 1;
}

.boxmoe-popup-content {
    border-radius: 16px;
    width: fit-content;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.boxmoe-popup-overlay.active .boxmoe-popup-content {
    transform: translateY(0);
}

.boxmoe-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-tertiary, #b0b0b0);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.boxmoe-popup-close:hover {
    color: var(--theme-primary, #35EB90);
    transform: rotate(90deg);
}

.boxmoe-popup-close:active {
    transform: rotate(90deg) scale(0.95);
}

body.boxmoe-popup-open {
    overflow: hidden;
}

/* payment-modal 系列 */
.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.payment-modal {
    background: var(--bg-secondary, #1a2332);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.payment-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary, #1f2937);
    border: 1px solid var(--border-primary, #2a3442);
    border-radius: 8px;
    color: var(--text-tertiary, #b0b0b0);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.payment-modal-close:hover {
    background: var(--bg-darker, #0d1117);
    border-color: var(--theme-primary, #35EB90);
    color: var(--theme-primary, #35EB90);
    transform: rotate(90deg);
}

.payment-modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* ========================================
   特殊弹窗样式
   ======================================== */

/* 加载弹窗 - 无关闭按钮 */
.category-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-loading-overlay.active {
    opacity: 1;
}

/* VIP 阻止弹窗 - 特殊样式 */
.vip-block-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vip-block-modal.active {
    opacity: 1;
}

.vip-block-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

/* 注册成功弹窗 - 特殊样式 */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.payment-modal {
    background: var(--bg-secondary, #1a2332);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.payment-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-primary, #2a3442);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.payment-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary, #f0f0f0);
}

.payment-modal-body {
    padding: 24px;
}

.payment-info {
    text-align: center;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--bg-tertiary, #1f2937);
    border-radius: 12px;
}

.payment-vip-name {
    font-size: 18px;
    color: var(--text-secondary, #e0e0e0);
    margin-bottom: 12px;
}

.payment-price {
    font-size: 36px;
    font-weight: bold;
    color: var(--theme-primary, #35EB90);
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.payment-method-btn {
    background: var(--bg-tertiary, #1f2937);
    border: 2px solid var(--border-primary, #2a3442);
    border-radius: 12px;
    padding: 24px 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.payment-method-btn:hover {
    border-color: var(--theme-primary, #35EB90);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(53, 235, 144, 0.2);
}

.payment-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-name {
    font-size: 16px;
    color: var(--text-primary, #f0f0f0);
    font-weight: 500;
}

.payment-tips {
    text-align: center;
    color: var(--text-tertiary, #b0b0b0);
    font-size: 14px;
    padding: 16px;
    background: var(--bg-tertiary, #1f2937);
    border-radius: 8px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .payment-modal {
        width: 95%;
        max-width: none;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }
}

/* 支付等待弹窗样式 */
.payment-waiting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

.payment-waiting-modal {
    background: var(--bg-secondary, #1a2332);
    border-radius: 16px;
    padding: 48px 32px;
    width: 90%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.payment-waiting-icon {
    margin-bottom: 24px;
}

.spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border: 4px solid var(--border-primary, #2a3442);
    border-top-color: var(--theme-primary, #35EB90);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.payment-waiting-title {
    font-size: 24px;
    color: var(--text-primary, #f0f0f0);
    margin-bottom: 12px;
}

.payment-waiting-desc {
    font-size: 16px;
    color: var(--text-secondary, #e0e0e0);
    margin-bottom: 8px;
}

.payment-waiting-tips {
    font-size: 14px;
    color: var(--text-tertiary, #b0b0b0);
    margin-bottom: 32px;
}

.payment-waiting-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}