/**
 * MVP789 / Dynamic Brand Admin Dashboard
 * Full Application Layout, Modular Components & Mobile Responsive Styles
 * File: public/admin/css/admin.css
 */

/* ========================================================
   1. RESET & BASE
   ======================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(0, 230, 118, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(139, 92, 246, 0.05) 0%, transparent 45%);
  color: var(--clay-text);
  min-height: 100vh;
  overflow-x: hidden;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* Common Utilities */
.d-none { display: none !important; }
.text-success { color: var(--clay-primary) !important; }
.text-danger { color: var(--clay-danger) !important; }
.text-warning { color: var(--clay-secondary) !important; }
.text-primary { color: #38bdf8 !important; }
.text-muted { color: var(--clay-text-muted) !important; }
.font-weight-bold { font-weight: 700 !important; }
.text-center { text-align: center !important; }

.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 20px; padding-bottom: 20px; }
.py-5 { padding-top: 36px; padding-bottom: 36px; }

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 20px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.ml-2 { margin-left: 8px; }

/* Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -10px;
  margin-right: -10px;
}
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 10px; box-sizing: border-box; }
.col-md-6 { flex: 0 0 100%; max-width: 100%; padding: 0 10px; box-sizing: border-box; }
.col-lg-6 { flex: 0 0 100%; max-width: 100%; padding: 0 10px; box-sizing: border-box; }

@media (min-width: 768px) {
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
}
@media (min-width: 992px) {
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
}

/* ========================================================
   2. AUTH / LOGIN VIEW (Claymorphism Centered Card)
   ======================================================== */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, #151d2e 0%, #080c14 80%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    inset 2px 2px 5px rgba(255, 255, 255, 0.08),
    inset -3px -3px 8px rgba(0, 0, 0, 0.7),
    0 24px 60px -10px rgba(0, 0, 0, 0.9);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--clay-primary);
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.25);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.login-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--clay-text-muted);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label,
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--clay-text-muted);
  margin-bottom: 8px;
}

.form-help {
  margin-top: 10px;
  font-size: 12px;
}

.form-help code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--clay-secondary);
}

/* ========================================================
   3. APP SHELL LAYOUT (Sidebar + Main)
   ======================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.admin-sidebar {
  width: 270px;
  background: #101624;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 18px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #00ff88, #00964b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 8px 18px -4px var(--clay-primary-glow), inset 2px 2px 4px rgba(255,255,255,0.4);
}

.brand-text h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  line-height: 1.2;
}

.brand-text span {
  font-size: 11px;
  color: var(--clay-primary);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-radius: var(--radius-md);
  color: var(--clay-text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  background: linear-gradient(145deg, #182236, #101624);
  color: #00ff88;
  border: 1px solid rgba(0, 230, 118, 0.2);
  border-left: 4px solid #00ff88;
  box-shadow: 
    inset 1px 1px 3px rgba(255, 255, 255, 0.08),
    inset -2px -2px 4px rgba(0, 0, 0, 0.4),
    0 4px 14px rgba(0, 0, 0, 0.35);
}

.nav-icon {
  font-size: 17px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}

.user-info strong {
  display: block;
  font-size: 13px;
  color: #fff;
}

.user-info small {
  font-size: 11px;
  color: var(--clay-text-muted);
}

/* ========================================================
   4. TOPBAR & MAIN CONTENT
   ======================================================== */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  padding-bottom: 80px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(16, 22, 36, 0.85);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

#sidebarToggle {
  display: none;
}

.topbar-title {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
}

.content-container {
  padding: 24px 28px;
  flex: 1;
}

/* ========================================================
   5. DASHBOARD KPIS & METRICS
   ======================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.kpi-title {
  font-size: 12px;
  color: var(--clay-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.kpi-icon {
  font-size: 20px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.kpi-footer {
  margin-top: 4px;
}

/* ========================================================
   6. TABLES & DATA LISTS
   ======================================================== */
.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--bg-surface);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.clay-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.clay-table th {
  background: rgba(12, 16, 26, 0.7);
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--clay-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.clay-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 13.5px;
  vertical-align: middle;
  white-space: nowrap;
}

.clay-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-meta .user-name {
  font-weight: 700;
  color: #fff;
}

.bank-meta strong {
  color: #fff;
}

/* ========================================================
   7. PROVIDER & GAMES CARDS
   ======================================================== */
.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.provider-clay-card {
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 
    inset 1px 1px 2px rgba(255, 255, 255, 0.05),
    0 4px 10px rgba(0, 0, 0, 0.3);
}

.provider-clay-card.active {
  border-color: rgba(0, 230, 118, 0.25);
}

.provider-clay-card.inactive {
  opacity: 0.6;
}

.game-thumbnail {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #1a2336;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-group-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.filter-group-row .clay-select {
  max-width: 240px;
}

.filter-group-row .clay-input {
  flex: 1;
  min-width: 200px;
}

/* ========================================================
   8. BANNERS GRID
   ======================================================== */
.banners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.banner-clay-card {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.banner-preview {
  position: relative;
  width: 100%;
  height: 140px;
  background: #0d121c;
}

.banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-status-tag {
  position: absolute;
  top: 10px;
  right: 10px;
}

.banner-details {
  padding: 16px;
}

.banner-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.banner-link {
  font-size: 12px;
  margin-bottom: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-actions {
  display: flex;
  gap: 8px;
}

/* ========================================================
   9. CLAY MODALS
   ======================================================== */
.clay-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 8, 14, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.clay-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.clay-modal-card {
  width: 100%;
  max-width: 540px;
  background: #141c2c;
  border-radius: var(--radius-lg);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    inset 2px 2px 4px rgba(255, 255, 255, 0.08),
    inset -3px -3px 6px rgba(0, 0, 0, 0.7),
    0 24px 50px rgba(0, 0, 0, 0.85);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 18px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

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

.btn-close:hover {
  color: #fff;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 20px;
}

/* ========================================================
   10. MOBILE BOTTOM NAVIGATION & SIDEBAR OVERLAY
   ======================================================== */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(16, 22, 36, 0.95);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 95;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--clay-text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}

.mobile-nav-item.active {
  color: var(--clay-primary);
}

.mobile-icon {
  font-size: 19px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ========================================================
   11. RESPONSIVE BREAKPOINTS (Mobile <= 900px)
   ======================================================== */
@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
  }

  #sidebarToggle {
    display: inline-flex;
  }

  .mobile-bottom-bar {
    display: flex;
  }

  .content-container {
    padding: 16px 14px;
  }

  .admin-topbar {
    padding: 14px 16px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   12. HIGH-TECH NEON ACCENTS & EXTENDED UTILITIES
   ======================================================== */
.border-cyan {
  border: 1px solid rgba(6, 182, 212, 0.4) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.12) !important;
}

.border-mint {
  border: 1px solid rgba(0, 230, 118, 0.4) !important;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.12) !important;
}

.border-warning {
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

.border-danger {
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

.border-success {
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
}

.text-cyan {
  color: #00f2fe !important;
}

.text-mint {
  color: #00e676 !important;
}

.font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
}

.font-size-lg {
  font-size: 20px !important;
}

/* Active tab button highlight */
.clay-btn.active {
  background: linear-gradient(135deg, #00e676, #00b0ff) !important;
  color: #080c14 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.4) !important;
}

/* Pulse Glow Animation */
@keyframes neonPulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; filter: brightness(1.2); }
  100% { transform: scale(1); opacity: 0.9; }
}

.pulse-badge {
  animation: neonPulse 2s infinite ease-in-out;
}

