/* ==========================================================================
   Admin Control Deck — Streamer Management Dashboard Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #0A0D14;
  --bg-card: #121826;
  --bg-card-hover: #182235;
  --bg-input: #080B10;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3B82F6;
  
  --primary-accent: #3B82F6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  
  --yt-red: #FF0033;
  --yt-red-glow: rgba(255, 0, 51, 0.35);
  
  --gold-primary: #FFD700;
  --gold-glow: rgba(255, 215, 0, 0.3);
  
  --emerald: #10B981;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  padding: 24px 16px 60px;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 0, 51, 0.06) 0%, transparent 40%);
}

.admin-container {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================================
   Header & Status Bar
   ========================================================================== */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF0033, #7928CA);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255, 0, 51, 0.4);
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  fill: #FFF;
}

.brand-text h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #FFF;
}

.brand-text p {
  font-size: 13px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald);
}

.status-pill.local-mode {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #F59E0B;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: statusBlink 1.5s infinite;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-header:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ==========================================================================
   Dashboard Grid Layout
   ========================================================================== */
.deck-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .deck-grid {
    grid-template-columns: 1fr;
  }
}

.deck-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title .icon {
  font-size: 18px;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-prefix {
  position: absolute;
  left: 14px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dim);
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 13px 14px 13px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: #FFF;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.form-input.has-prefix {
  padding-left: 36px;
}

.form-input:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
  color: var(--text-dim);
}

/* Quick Amount Preset Chips */
.quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.chip-btn.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--primary-accent);
  color: #60A5FA;
}

/* Big Trigger Button */
.btn-primary-trigger {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  border: none;
  border-radius: 14px;
  color: #FFF;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-primary-trigger:hover {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.55);
}

.btn-primary-trigger:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Side Widgets & Stats
   ========================================================================== */
.stats-card-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-item-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.stat-value-display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.stat-big-val {
  font-size: 26px;
  font-weight: 900;
  color: #FFF;
}

.stat-sub-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-primary);
}

.quick-action-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action-small {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-small:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.btn-action-small.btn-danger {
  color: #F87171;
  border-color: rgba(248, 113, 113, 0.25);
}

.btn-action-small.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Instant Test Buttons Deck */
.test-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-test {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-test:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.btn-test.gold {
  border-color: rgba(255, 215, 0, 0.35);
  background: rgba(255, 215, 0, 0.08);
  color: #FFE082;
}

.btn-test.gold:hover {
  background: rgba(255, 215, 0, 0.16);
  box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-test.cyan {
  border-color: rgba(0, 240, 255, 0.35);
  background: rgba(0, 240, 255, 0.08);
  color: #67E8F9;
}

.btn-test.cyan:hover {
  background: rgba(0, 240, 255, 0.16);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

/* ==========================================================================
   Activity History Table
   ========================================================================== */
.history-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 13px;
  transition: background 0.15s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.history-main-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.history-name {
  font-weight: 700;
  color: #FFF;
}

.history-msg {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-amount {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--gold-primary);
}

.history-empty {
  text-align: center;
  padding: 30px 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* ==========================================================================
   Settings Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.btn-close-modal:hover {
  color: #FFF;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-accent);
  margin-top: 4px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

/* Toast Notifications in Admin */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFF;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 99999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
