/* =====================================================
   Sprint 2-8 — added components
   ===================================================== */

/* Currency / Lang selector dropdown */
.currency-select, .lang-select { position: relative; }
.currency-btn, .lang-btn {
  padding: 0.5rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.currency-menu {
  position: absolute;
  top: 56px;
  right: 0;
  background: linear-gradient(165deg, rgba(15, 11, 5, 0.98), rgba(5, 5, 8, 0.98));
  border: 1px solid rgba(var(--theme-primary-rgb), 0.2);
  border-radius: 14px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  z-index: 9999;
  display: grid;
  gap: 2px;
  animation: notifIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.currency-menu__item {
  background: none;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background 0.2s;
}
.currency-menu__item:hover { background: rgba(var(--theme-primary-rgb), 0.08); }
.currency-menu__item.active {
  background: rgba(var(--theme-primary-rgb), 0.15);
  color: var(--theme-primary);
}
.currency-menu__sym {
  width: 24px;
  text-align: center;
  font-weight: 800;
  color: var(--theme-primary);
}
.lang-menu { right: -10px; min-width: 200px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}
.modal-card {
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  animation: authCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.modal-card--wide { max-width: 720px; }
.modal-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-card__head h3 {
  margin: 0;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
}
.modal-card__close {
  background: none;
  border: none;
  color: var(--theme-muted);
  cursor: pointer;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: background 0.2s;
}
.modal-card__close:hover { background: rgba(255, 93, 120, 0.15); color: #ff5d78; }
.modal-card__body { padding: 22px 24px; }
.modal-card__foot {
  padding: 14px 24px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Crate flip animation */
.crate-reveal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10005;
  animation: fadeIn 0.3s ease;
}
.crate-shake {
  font-size: 8rem;
  filter: drop-shadow(0 0 40px rgba(var(--theme-primary-rgb), 0.5));
  animation: crateShake 1.5s ease-in-out;
}
.crate-burst {
  font-size: 3.2rem;
  margin: 1rem 0;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: burstPop 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes crateShake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-6deg) scale(1.05); }
  20%, 40%, 60%, 80% { transform: rotate(6deg) scale(1.05); }
  95% { transform: scale(1.3); filter: brightness(2) drop-shadow(0 0 80px rgba(var(--theme-primary-rgb), 1)); }
}
@keyframes burstPop {
  0% { opacity: 0; transform: scale(0.4); }
  60% { transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

/* Gift coupon card */
.gift-card {
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb), 0.18), rgba(var(--theme-accent-rgb), 0.1)), linear-gradient(165deg, var(--surface-2), var(--surface-3));
  border: 1px solid rgba(var(--theme-primary-rgb), 0.3);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.gift-card::before {
  content: '🎁';
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 9rem;
  opacity: 0.05;
}
.gift-card__code {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(var(--theme-primary-rgb), 0.45);
  border-radius: 12px;
  padding: 12px 20px;
  font-family: 'TASA Explorer', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--theme-primary);
  text-shadow: 0 0 20px rgba(var(--theme-primary-rgb), 0.6);
  margin: 1rem auto;
  display: inline-block;
}

/* Stock badge */
.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.stock-pill.low { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
.stock-pill.out { background: rgba(255, 93, 120, 0.15); color: #ff5d78; border-color: rgba(255, 93, 120, 0.3); }

/* 2FA setup card */
.twofa-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}
.twofa-qr {
  background: white;
  padding: 12px;
  border-radius: 12px;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-family: monospace;
  font-size: 0.78rem;
  text-align: center;
  border: 4px solid var(--theme-primary);
}
.twofa-secret {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(var(--theme-primary-rgb), 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: monospace;
  color: var(--theme-primary);
  text-align: center;
  letter-spacing: 2px;
}

/* Verify code display */
.verify-code {
  text-align: center;
  font-family: 'TASA Explorer', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--theme-primary);
  text-shadow: 0 0 40px rgba(var(--theme-primary-rgb), 0.5);
  padding: 2rem 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  margin: 1.5rem 0;
}

/* Rich text editor toolbar */
.editor-shell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-soft);
}
.editor-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.editor-btn:hover { background: rgba(var(--theme-primary-rgb), 0.12); color: var(--theme-primary); }
.editor-btn.is-active { background: rgba(var(--theme-primary-rgb), 0.18); color: var(--theme-primary); }
.editor-content {
  min-height: 220px;
  padding: 14px 18px;
  outline: none;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.7;
  font-size: 0.95rem;
}
.editor-content:empty::before {
  content: attr(data-placeholder);
  color: var(--theme-muted);
  pointer-events: none;
}

/* AI suggest box */
.ai-suggest-box {
  position: relative;
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb), 0.07), rgba(var(--theme-accent-rgb), 0.04));
  border: 1px solid rgba(var(--theme-primary-rgb), 0.35);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 1rem 0;
}
.ai-suggest-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--theme-primary), var(--theme-accent));
  border-radius: 999px 0 0 999px;
}
.ai-suggest-box__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--theme-primary);
  font-weight: 800;
  font-size: 0.85rem;
}
.ai-suggest-box__head i { animation: aiPulse 2s ease-in-out infinite; }
@keyframes aiPulse { 50% { opacity: 0.6; transform: rotate(360deg); } }

/* RCON / Console */
.console-wrap {
  background: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
}
.console-output {
  padding: 14px;
  min-height: 240px;
  max-height: 400px;
  overflow-y: auto;
  color: #a5e3a5;
  white-space: pre-wrap;
  word-break: break-word;
}
.console-output > div { margin-bottom: 4px; }
.console-output .console-cmd { color: var(--theme-primary); }
.console-output .console-err { color: #ff5d78; }
.console-output .console-warn { color: var(--theme-accent); }
.console-output .console-time { color: rgba(255, 255, 255, 0.4); font-size: 0.75rem; }

/* Theme preview frame */
.theme-preview-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-mid);
  height: 360px;
  background: var(--theme-bg);
  position: relative;
}
.theme-preview-iframe {
  position: relative;
  height: 100%;
  background:
    radial-gradient(circle at 30% 20%, rgba(var(--theme-primary-rgb), 0.15), transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(var(--theme-accent-rgb), 0.1), transparent 50%),
    var(--theme-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  color: #fff;
}
.theme-preview-iframe h2 {
  background: linear-gradient(180deg, #fff 30%, var(--theme-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: 'TASA Explorer', sans-serif;
  font-size: 2.5rem;
  margin: 0;
}

/* Color picker row */
.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.color-row__label { flex: 1; font-size: 0.88rem; color: #fff; }
.color-row__swatch {
  width: 40px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-mid);
  cursor: pointer;
}
.color-row code {
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: monospace;
  color: var(--theme-muted);
}

/* Form builder drag-drop */
.formbuilder-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.formbuilder-palette,
.formbuilder-canvas {
  background: linear-gradient(165deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 18px;
  min-height: 400px;
}
.formbuilder-palette h4,
.formbuilder-canvas h4 { margin: 0 0 1rem; color: #fff; font-size: 0.95rem; }
.formbuilder-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.formbuilder-item:hover {
  border-color: rgba(var(--theme-primary-rgb), 0.4);
  background: rgba(var(--theme-primary-rgb), 0.04);
}
.formbuilder-item.dragging { opacity: 0.4; transform: rotate(-1deg); }
.formbuilder-canvas .formbuilder-item {
  border-color: rgba(var(--theme-primary-rgb), 0.25);
}
.formbuilder-canvas__drop {
  border: 2px dashed rgba(var(--theme-primary-rgb), 0.3);
  border-radius: 12px;
  padding: 18px;
  min-height: 200px;
  text-align: center;
  color: var(--theme-muted);
  font-size: 0.85rem;
}
.formbuilder-canvas__drop.over { background: rgba(var(--theme-primary-rgb), 0.06); }

/* i18n translation table */
.i18n-table {
  width: 100%;
  border-collapse: collapse;
}
.i18n-table th, .i18n-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.i18n-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--theme-muted);
}
.i18n-table input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}
.i18n-table input:focus { border-color: var(--theme-primary); }

/* Mobile bottom bar (sticky CTA) */
.mobile-bottom-bar {
  display: none;
}
@media (max-width: 768px) {
  .mobile-bottom-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(8, 6, 4, 0.95), rgba(8, 6, 4, 0.98));
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(var(--theme-primary-rgb), 0.2);
    z-index: 9000;
    padding: 8px 4px;
  }
  body { padding-bottom: 64px; }
  .mobile-bottom-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 700;
    gap: 4px;
    padding: 6px 2px;
    border-radius: 8px;
  }
  .mobile-bottom-bar a i { font-size: 1.1rem; }
  .mobile-bottom-bar a.active { color: var(--theme-primary); }
}

/* Loading skeleton */
.skel {
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  border-radius: 8px;
  animation: skelShimmer 1.4s ease-in-out infinite;
}
@keyframes skelShimmer { to { background-position: -200% 0; } }

/* Live online users dot indicator */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  margin-right: 5px;
  animation: livePulse2 1.6s ease-in-out infinite;
}
@keyframes livePulse2 {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* Player count chart card */
.player-chart-card {
  background: linear-gradient(165deg, var(--surface-2), var(--surface-3));
  border: 1px solid rgba(var(--theme-primary-rgb), 0.1);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 1.5rem;
}
