/* ==========================================================================
   RLGX CUP — ADMIN PORTAL
   100% Monochrome Theme — Strictly Zero Emojis.
   GX eSports Official Platform
   ========================================================================== */

:root {
  --bg-black: #050505;
  --bg-surface: #0c0c0c;
  --bg-card: #121212;
  --bg-hover: #181818;
  --bg-input: #080808;

  --border-light: #2c2c2c;
  --border-subtle: #1a1a1a;
  --border-active: #ffffff;

  --text-white: #ffffff;
  --text-secondary: #999999;
  --text-muted: #555555;

  --font-arabic: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Syne', var(--font-arabic);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --transition-fast: 0.16s ease;
}

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

html {
  background-color: var(--bg-black);
  color: var(--text-white);
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-black);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(ellipse at 50% 10%, rgba(255, 255, 255, 0.04) 0%, rgba(5, 5, 5, 0.94) 65%),
    linear-gradient(to bottom, rgba(5, 5, 5, 0.82) 0%, rgba(5, 5, 5, 0.92) 50%, rgba(5, 5, 5, 0.98) 100%),
    url('assets/bg_stadium_bw.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  filter: grayscale(100%) contrast(125%) brightness(0.65);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.container-fluid {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-arabic);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  line-height: 1;
}

.btn-primary {
  background-color: var(--text-white);
  color: var(--bg-black);
  border-color: var(--text-white);
}

.btn-primary:hover {
  background-color: #e5e5e5;
  border-color: #e5e5e5;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-white);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-white);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  color: var(--text-white);
  border-color: var(--border-light);
  background-color: var(--bg-hover);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
  padding: 14px;
}

/* Spinner */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-muted);
  border-top-color: var(--bg-black);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Auth View */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background-color: rgba(12, 12, 12, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75);
}

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

.auth-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.auth-cup-logo {
  height: 48px;
  width: auto;
  filter: grayscale(100%);
}

.auth-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-light);
}

.auth-gx-logo {
  height: 28px;
  width: auto;
  filter: grayscale(100%) brightness(1.2);
}

.auth-badge {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-white);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--border-active);
}

.alert-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 18px;
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
  color: var(--text-white);
}

/* Dashboard View */
.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.topbar-logo {
  height: 34px;
  width: auto;
  filter: grayscale(100%);
}

.topbar-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-light);
}

.topbar-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.3px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  direction: ltr;
}

/* Dashboard Main */
.dashboard-main {
  flex-grow: 1;
  padding: 32px 0 60px;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-card-highlight {
  border-color: var(--border-light);
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-heading);
}

/* Table Section */
.table-section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-header-bar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 6px;
  background-color: var(--bg-black);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px 14px;
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-white);
}

.tab-btn.active {
  background-color: var(--text-white);
  color: var(--bg-black);
}

/* Table Controls */
.table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-wrap {
  position: relative;
  width: 280px;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--border-active);
}

/* Table */
.table-container {
  overflow-x: auto;
}

.teams-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.9rem;
}

.teams-table th {
  padding: 14px 18px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
}

.teams-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.teams-table tr:hover td {
  background-color: var(--bg-hover);
}

.table-empty-row {
  text-align: center;
  padding: 40px !important;
  color: var(--text-secondary);
}

/* Table Team Cell */
.team-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-avatar-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-black);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

.team-avatar-fallback {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-white);
}

.team-name-text {
  font-weight: 700;
  color: var(--text-white);
}

.rank-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.tiktok-cell-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  direction: ltr;
}

.tiktok-cell-link:hover {
  color: var(--text-white);
}

.date-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.status-badge-accepted {
  background-color: var(--text-white);
  color: var(--bg-black);
}

.status-badge-pending {
  background-color: transparent;
  color: var(--text-white);
  border: 1px solid var(--border-light);
}

.status-badge-rejected {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-light);
}

/* Action Buttons in Row */
.action-buttons-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.btn-accept {
  background-color: var(--text-white);
  color: var(--bg-black);
  border: 1px solid var(--text-white);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-accept:hover {
  background-color: #e2e2e2;
}

.btn-reject {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-reject:hover {
  color: var(--text-white);
  border-color: var(--text-white);
}

.btn-delete {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 5px 8px;
  font-size: 0.78rem;
}

.btn-delete:hover {
  color: var(--text-white);
  border-color: var(--border-light);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .table-header-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap {
    width: 100%;
  }
}
