/* ==========================================================================
   Nexus Gaming Mart - Modern Admin Dashboard Stylesheet
   ========================================================================== */

:root {
  --admin-bg: #0f172a;
  --admin-card-bg: #1e293b;
  --admin-border: #334155;
  --admin-sidebar-bg: #0b1120;
  --xbox-green: #107c10;
  --xbox-green-light: #22c55e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background: var(--admin-bg);
  color: var(--text-main);
  min-height: 100vh;
}

/* ==========================================================================
   Auth Screen
   ========================================================================== */
.auth-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1e293b 0%, #0b1120 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.auth-card {
  background: #1e293b;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 35px 30px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.auth-brand {
  margin-bottom: 25px;
}

.auth-icon {
  font-size: 3rem;
  color: var(--xbox-green-light);
  margin-bottom: 12px;
}

.auth-brand h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.auth-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.error-text {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 10px;
  font-weight: 600;
}

.auth-footer {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--admin-border);
}

.auth-footer a {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--xbox-green-light);
}

/* ==========================================================================
   Admin Layout
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar-bg);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--admin-border);
}

.brand-icon {
  font-size: 1.8rem;
  color: var(--xbox-green-light);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #ffffff;
  display: block;
}

.brand-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--xbox-green-light);
  letter-spacing: 1px;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.nav-tab-btn.active {
  background: rgba(16, 124, 16, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.sidebar-footer {
  padding: 20px 14px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-view-store {
  background: #1e293b;
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  display: block;
  border: 1px solid var(--admin-border);
}

.btn-logout {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-topbar {
  background: #131d31;
  border-bottom: 1px solid var(--admin-border);
  padding: 18px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left h1 {
  font-size: 1.35rem;
  font-weight: 800;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-pill.live {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wa-active-pill {
  background: #1e293b;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  color: #22c55e;
  border: 1px solid var(--admin-border);
}

.admin-content-wrap {
  padding: 30px;
  flex-grow: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ==========================================================================
   Stats Cards
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-icon.green { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.stat-val {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Action Banner & Content Cards
   ========================================================================== */
.action-banner {
  background: linear-gradient(135deg, #13241b 0%, #1e293b 100%);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 16px;
}

.ab-text h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.ab-text p {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.ab-btns {
  display: flex;
  gap: 12px;
}

.content-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 25px;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--admin-border);
}

.subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.88rem;
}

.admin-table th {
  background: #131d31;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.thumb-img {
  width: 60px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

.badge-cat {
  background: #334155;
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-cat.coming_soon {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.muted-cell {
  color: var(--text-muted);
  font-style: italic;
  padding: 30px !important;
}

.text-center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-primary, .btn-admin-primary {
  background: var(--xbox-green);
  color: #fff;
}

.btn-primary:hover, .btn-admin-primary:hover {
  background: #15803d;
}

.btn-secondary {
  background: #334155;
  color: #fff;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-danger-outline {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-link {
  background: transparent;
  color: var(--xbox-green-light);
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}

.action-btn-row {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   Toolbar & Forms
   ========================================================================== */
.toolbar-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0f172a;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 8px 14px;
  width: 320px;
}

.search-box input {
  background: transparent;
  border: none;
  color: #fff;
  width: 100%;
  outline: none;
  font-size: 0.88rem;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-row select, .form-group select, .form-group input, .form-group textarea {
  background: #0f172a;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: #fff;
  padding: 9px 12px;
  font-size: 0.88rem;
  outline: none;
  width: 100%;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.hint-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.hint-text code {
  color: #4ade80;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 5px;
  border-radius: 4px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-checkbox {
  margin-bottom: 18px;
}

.form-checkbox label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.cover-preview-box {
  background: #0b1120;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 16px;
}

.cover-preview-box span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cover-preview-box img {
  width: 100%;
  max-width: 250px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  background: var(--admin-card-bg);
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--admin-border);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--admin-border);
}

.backup-action-row {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.json-preview-wrap label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.json-preview-wrap textarea {
  width: 100%;
  background: #0b1120;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: #4ade80;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 12px;
}
