/**
 * modals.css - 通用弹窗样式
 * 登录、充值、确认等弹窗
 */

/* === Modals === */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 9999;
    align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.modal-container {
    background: var(--modal-bg); width: 400px; max-width: 90%;
    max-height: 90vh;
    border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color); display: flex; flex-direction: column;
    overflow: hidden; animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 20px; 
    border-bottom: 1px solid var(--border-color); 
    background: #2b2c2f; 
}
.modal-header h3 { margin: 0; font-size: 1.1rem; color: var(--text-color); }

.close-modal-btn { 
    background: transparent !important; 
    border: none !important; 
    color: #888 !important; 
    font-size: 1.5rem !important; 
    cursor: pointer; 
    line-height: 1; 
    padding: 5px !important;
    transition: color 0.2s;
}
.close-modal-btn:hover { color: white !important; }

.modal-body { 
    padding: 20px; 
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin !important;
}

.modal-body::-webkit-scrollbar {
    display: block !important;
    width: 6px !important;
}
.modal-body::-webkit-scrollbar-thumb {
    background: #444 !important;
    border-radius: 3px !important;
}

.auth-form-group { margin-bottom: 15px; }
.auth-form-group label { display: block; margin-bottom: 5px; font-size: 0.8rem; color: #ccc; }
.auth-form-group input { width: 100%; padding: 10px; background: #40414f; border: 1px solid var(--border-color); border-radius: 4px; color: white; box-sizing: border-box; font-size: 0.9rem; }

.auth-btn { width: 100%; padding: 10px; background: var(--accent-color); color: white; border: none; border-radius: 4px; font-size: 0.95rem; cursor: pointer; margin-top: 10px; }
.auth-btn:hover { background: #0e8c6d; }
.auth-btn-secondary { background: #555; margin-top: 5px; font-size: 0.8rem; padding: 5px 10px; width: auto; position: absolute; right: 0; top: 22px; }
.error-msg { color: #ff6b6b; font-size: 0.8rem; margin-top: 5px; text-align: center; min-height: 1.2em; }

.modal-tabs { display: flex; border-bottom: 1px solid var(--border-color); }
.modal-tab { flex: 1; text-align: center; padding: 12px; cursor: pointer; font-size: 0.9rem; color: #888; background: #2b2c2f; }
.modal-tab.active { color: var(--accent-color); background: var(--modal-bg); border-bottom: 2px solid var(--accent-color); font-weight: bold; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* 充值样式 */
.recharge-list { max-height: 400px; overflow-y: auto; padding: 15px; }
.recharge-option {
    border: 1px solid var(--border-color); padding: 10px; border-radius: 5px;
    margin-bottom: 10px; cursor: pointer; background: #2b2c2f; display: flex;
    justify-content: space-between; align-items: center;
}
.recharge-option:hover { border-color: var(--accent-color); }
.recharge-option.selected { border-color: var(--accent-color); background: rgba(16, 163, 127, 0.1); }
.price-tag { color: var(--highlight-border); font-weight: bold; }

.level-card {
    border: 1px solid #444;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    background: #2b2c2f;
    margin-bottom: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 🌟 等级配色方案 */
/* Lv.1: 初级 - 青色系 */
.level-card[data-level-id="1"] { background: linear-gradient(145deg, #1e3a34, #1a1b1e); border-color: #2d5a4e; }
.level-card[data-level-id="1"] .level-price { color: #4ade80; }

/* Lv.2: 进阶 - 蓝色系 */
.level-card[data-level-id="2"] { background: linear-gradient(145deg, #1e293b, #1a1b1e); border-color: #334155; }
.level-card[data-level-id="2"] .level-price { color: #60a5fa; }

/* Lv.3: 高级 - 紫色系 */
.level-card[data-level-id="3"] { background: linear-gradient(145deg, #3b0764, #1a1b1e); border-color: #581c87; }
.level-card[data-level-id="3"] .level-price { color: #c084fc; }

/* Lv.4: 核心 - 琥珀/金橙色系 */
.level-card[data-level-id="4"] { background: linear-gradient(145deg, #451a03, #1a1b1e); border-color: #78350f; }
.level-card[data-level-id="4"] .level-price { color: #fbbf24; }

/* Lv.5: 旗舰 - 红黑/至尊系 */
.level-card[data-level-id="5"] { background: linear-gradient(145deg, #450a0a, #1a1b1e); border-color: #7f1d1d; }
.level-card[data-level-id="5"] .level-price { color: #f87171; }

.level-card:hover { 
    border-color: #888; 
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.level-card.selected { 
    border-color: var(--accent-color) !important; 
    box-shadow: 0 0 20px rgba(16, 163, 127, 0.4);
    animation: breathing 2s infinite;
}

@keyframes breathing {
    0% { box-shadow: 0 0 5px rgba(16, 163, 127, 0.2); }
    50% { box-shadow: 0 0 20px rgba(16, 163, 127, 0.5); }
    100% { box-shadow: 0 0 5px rgba(16, 163, 127, 0.2); }
}
.level-card.selected::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
}
.level-name { 
    font-weight: bold; 
    color: #fff; 
    margin-bottom: 8px; 
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}
.level-price { 
    color: var(--highlight-border); 
    font-size: 1.8rem; 
    font-weight: 800; 
    margin-bottom: 12px;
}
.level-benefits { 
    font-size: 0.9rem; 
    color: #888; 
    line-height: 1.6;
}

/* 禁用的充值等级卡片样式 */
.level-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: #1a1a1a !important;
    border-color: #333 !important;
}

.level-card.disabled:hover {
    border-color: #333 !important;
    transform: none;
    box-shadow: none;
}

.level-card.disabled .level-price {
    color: #666 !important;
}

.level-card.disabled .level-name {
    color: #888;
}

.level-card .disabled-hint {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #444;
    color: #888;
    font-size: 0.75rem;
    text-align: center;
}

/* 通用确认 Modal */
.confirm-body { text-align: center; color: #ccc; }
.confirm-footer { display: flex; gap: 10px; margin-top: 20px; }
.confirm-btn { flex: 1; padding: 10px; border-radius: 4px; cursor: pointer; border: none; font-weight: bold; }
.confirm-btn.yes { background: var(--accent-color); color: white; }
.confirm-btn.no { background: #444; color: #ccc; }

/* 通用按钮样式 */
.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-color), #0d8a6a);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 163, 127, 0.4);
}

.btn-secondary {
    padding: 12px 24px;
    background: #3b3c3f;
    border: 1px solid #555;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #4b4c4f;
}
