/* 兌換碼系統樣式 */

/* modal */
.promo-modal-overlay {
  position: fixed; inset: 0; z-index: 11500;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; transition: opacity 0.25s ease;
}
.promo-modal-overlay.open { opacity: 1; }
.promo-modal-card {
  max-width: 440px; width: 100%;
  background: linear-gradient(180deg, #1a1f3a 0%, #0e1226 100%);
  border: 1px solid rgba(244,196,48,0.40);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 36px rgba(244,196,48,0.12);
  padding: 24px 22px 20px;
  color: #fff;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.promo-modal-overlay.open .promo-modal-card {
  transform: translateY(0) scale(1);
}
.promo-modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 50%;
  color: #ddd; font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.promo-modal-title {
  font-size: 20px; font-weight: 900;
  color: #FFD54F;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.promo-modal-desc {
  font-size: 13px;
  opacity: 0.78;
  line-height: 1.65;
  margin: 6px 0 14px;
}

/* 輸入框 + 按鈕 */
.promo-input-wrap { margin-bottom: 12px; }
.promo-code-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0,0,0,0.30);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  text-align: center;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
}
.promo-code-input:focus {
  outline: none;
  border-color: #FFD54F;
  box-shadow: 0 0 0 3px rgba(255,213,79,0.20);
}
.promo-code-input::placeholder { opacity: 0.35; letter-spacing: 1px; }

.promo-redeem-btn {
  width: 100%;
  padding: 13px 14px;
  background: linear-gradient(135deg, #FFD54F, #d9a829);
  color: #1a1a1a;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(244,196,48,0.30);
  transition: transform 0.15s, box-shadow 0.2s;
  font-family: inherit;
}
.promo-redeem-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(244,196,48,0.40);
}
.promo-redeem-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 結果區 */
.promo-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  text-align: center;
  min-height: 0;
  transition: all 0.25s;
}
.promo-result:empty { padding: 0; }
.promo-result.error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.35);
  color: #f87171;
}
.promo-result.success {
  background: linear-gradient(180deg, rgba(76,175,80,0.18), rgba(76,175,80,0.05));
  border: 1px solid rgba(76,175,80,0.45);
  color: #fff;
  padding: 18px 14px;
}
.promo-success-icon { font-size: 36px; margin-bottom: 6px; }
.promo-success-title { font-size: 17px; font-weight: 900; color: #81c784; }
.promo-success-name { font-size: 13px; opacity: 0.85; margin: 4px 0 6px; }
.promo-success-reward {
  font-size: 16px; font-weight: 800; color: #FFD54F;
  margin-top: 6px;
}

/* form */
.promo-form { display: flex; flex-direction: column; gap: 10px; }
.promo-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
  opacity: 0.85;
}
.promo-form input {
  padding: 8px 10px;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
}
.promo-form input:focus {
  outline: none;
  border-color: #FFD54F;
}
.promo-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* admin 區塊 */
.admin-section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.admin-section-header h3 {
  font-size: 16px; font-weight: 900;
  color: #FFD54F;
}
.admin-promo-create-btn {
  padding: 7px 14px;
  background: linear-gradient(135deg, #FFD54F, #d9a829);
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.admin-promo-table-wrap { overflow-x: auto; }
.admin-promo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-promo-table th,
.admin-promo-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-align: left;
}
.admin-promo-table th {
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.5px;
}
.promo-code-cell {
  background: rgba(255,213,79,0.12);
  color: #FFD54F;
  padding: 3px 8px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-weight: 800;
  font-size: 12px;
}
.promo-status.on  { color: #81c784; font-weight: 700; }
.promo-status.off { color: #ef9a9a; font-weight: 700; }
.admin-promo-action-btn {
  padding: 5px 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  margin-right: 4px;
}
.admin-promo-action-btn:hover {
  background: rgba(255,255,255,0.14);
}

/* 用戶下拉選單裡的兌換碼按鈕（沿用既有樣式只是 icon 不同）*/

/* A 型兌換成功後的「立即領取」按鈕 */
.promo-cta-wrap {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,213,79,0.30);
  text-align: center;
}

/* 大 BONUS 標題 — 漸層金字 + 兩側星塵 */
.promo-bonus-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  animation: promoBonusFloat 2.4s ease-in-out infinite;
}
@keyframes promoBonusFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.promo-bonus-text {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(135deg, #FFE082 0%, #FFD54F 35%, #f59e0b 70%, #FFD54F 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 2px 6px rgba(245,158,11,0.55))
    drop-shadow(0 0 18px rgba(255,213,79,0.35));
  animation: promoBonusShine 3s linear infinite;
}
@keyframes promoBonusShine {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.promo-bonus-spark {
  font-size: 18px;
  color: #FFD54F;
  text-shadow: 0 0 10px rgba(255,213,79,0.8);
  animation: promoSparkRotate 2s linear infinite;
}
.promo-bonus-spark:last-child { animation-direction: reverse; }
@keyframes promoSparkRotate {
  0%   { transform: rotate(0deg)   scale(1); }
  50%  { transform: rotate(180deg) scale(1.25); }
  100% { transform: rotate(360deg) scale(1); }
}
.promo-cta-hint {
  font-size: 13px;
  color: #FFD54F;
  margin-bottom: 10px;
  line-height: 1.5;
}
.promo-cta-btn {
  width: 100%;
  padding: 13px 14px;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(239,68,68,0.40);
  transition: transform 0.15s, box-shadow 0.2s;
  font-family: inherit;
}
.promo-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239,68,68,0.55);
}
/* A 型大按鈕：兩行文案、寬厚、脈動 */
.promo-cta-btn-big {
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.5;
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 60%, #FFD54F 100%);
  border: 2px solid rgba(255,229,160,0.45);
  box-shadow:
    0 6px 22px rgba(239,68,68,0.50),
    inset 0 1px 0 rgba(255,255,255,0.25);
  animation: promoBtnPulse 2s ease-in-out infinite;
}
.promo-cta-btn-big:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 30px rgba(239,68,68,0.70),
    inset 0 1px 0 rgba(255,255,255,0.35);
}
@keyframes promoBtnPulse {
  0%, 100% { box-shadow: 0 6px 22px rgba(239,68,68,0.50), inset 0 1px 0 rgba(255,255,255,0.25); }
  50%      { box-shadow: 0 8px 30px rgba(245,158,11,0.75), inset 0 1px 0 rgba(255,255,255,0.35); }
}
/* 冷卻倒數 disabled */
.promo-cta-btn-disabled,
.promo-cta-btn-disabled:hover {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.55);
  border: 2px solid rgba(255,255,255,0.10);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* 冷卻完成 ready（綠金） */
.promo-cta-btn-ready {
  background: linear-gradient(135deg, #d4a85a, #f59e0b);
  box-shadow: 0 4px 14px rgba(212,168,90,0.55);
  animation: pcReadyPulse 1.8s ease-in-out infinite;
}
.promo-cta-btn-ready:hover {
  box-shadow: 0 6px 22px rgba(212,168,90,0.75);
}
@keyframes pcReadyPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(212,168,90,0.55); }
  50%      { box-shadow: 0 4px 22px rgba(212,168,90,0.90); }
}
.promo-cta-done {
  color: #81c784 !important;
  font-weight: 800;
  text-align: center;
}
.promo-cta-claimed {
  text-align: center;
  font-size: 13px;
  color: #81c784;
  padding: 10px;
  background: rgba(76,175,80,0.10);
  border-radius: 10px;
  font-weight: 700;
}

/* 推廣 widget — 站內各處的入口 */
.referral-widget {
  margin: 24px auto;
  max-width: 560px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(239,68,68,0.10), rgba(245,158,11,0.08));
  border: 1px solid rgba(239,68,68,0.30);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.referral-widget-inline {
  margin: 18px 0 8px;
}
.referral-widget-text {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  min-width: 0;
}
.referral-widget-btn {
  padding: 10px 18px;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(239,68,68,0.35);
  transition: transform 0.15s;
  font-family: inherit;
}
.referral-widget-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239,68,68,0.50);
}
.referral-widget-btn:active { transform: scale(0.97); }

/* 中獎彈窗的「贏更多」按鈕 */
.referral-win-more-btn {
  padding: 10px 22px;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.20);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  margin: 8px 4px;
  box-shadow: 0 4px 14px rgba(239,68,68,0.40);
  font-family: inherit;
}
.referral-win-more-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239,68,68,0.55);
}

/* ─── 📊 API 配額監控 widget ─── */
.quota-today-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px; margin-bottom: 18px;
}
.quota-today-card.quota-braked {
  border-color: #ef5350; background: rgba(239,83,80,0.06);
}
.quota-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; font-size: 14px;
}
.quota-label { color: var(--text-secondary); }
.quota-value { font-weight: 700; }
.quota-progress {
  width: 100%; height: 8px; background: rgba(255,255,255,0.06);
  border-radius: 999px; margin-top: 10px; overflow: hidden;
}
.quota-progress-fill {
  height: 100%; border-radius: 999px; transition: width 0.4s ease;
}
.quota-brake-on { color: #ef5350; font-weight: 800; }
.quota-brake-off { color: #4caf50; font-weight: 700; font-size: 13px; }
.quota-history-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.quota-history-bars {
  display: flex; align-items: flex-end; gap: 4px;
  height: 110px; padding: 8px 0 0;
}
.quota-bar-item {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
}
.quota-bar-fill {
  width: 100%; min-height: 2px; border-radius: 4px 4px 0 0;
  transition: height 0.4s ease;
}
.quota-bar-label {
  font-size: 9px; color: var(--text-muted); white-space: nowrap;
}
