/* ========================================
   VC Club — Premium Dark/Gold CSS
   RTL Persian Design System
   ======================================== */

/* --- Google Fonts: Vazirmatn for Persian --- */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
  --bg-base:       #0a0a0b;
  --bg-card:       #111114;
  --bg-card-hover: #16161a;
  --bg-input:      #0e0e11;

  --gold:          #c9a84c;
  --gold-light:    #e2c077;
  --gold-dim:      #7a6130;
  --gold-border:   rgba(201, 168, 76, 0.18);

  --text-primary:  #f0ede6;
  --text-muted:    #7a7870;
  --text-subtle:   #4a4845;

  --border:        rgba(255, 255, 255, 0.06);
  --border-gold:   rgba(201, 168, 76, 0.25);

  --radius:        10px;
  --radius-lg:     16px;

  --font:          'Vazirmatn', system-ui, sans-serif;

  --transition:    0.2s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  lang: fa;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- Layout Containers --- */
.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.page--top {
  justify-content: flex-start;
  padding-top: 48px;
}

/* --- Wordmark / Logo --- */
.wordmark {
  text-align: center;
  margin-bottom: 56px;
}

.wordmark__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
}

.wordmark__name {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.1;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.card--narrow {
  max-width: 480px;
  width: 100%;
}

/* --- Status Block --- */
.status-block {
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 32px;
}

.status-badge--active {
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid var(--gold-border);
  color: var(--gold);
}

.status-badge--inactive {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.status-badge--full {
  background: rgba(180, 80, 80, 0.08);
  border: 1px solid rgba(180,80,80,0.2);
  color: #d08080;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot--pulse {
  animation: pulse 2s infinite;
}

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

.status-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.status-message {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--gold);
  color: #0a0a0b;
  width: 100%;
}

.btn--primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--border-gold);
  color: var(--gold);
}

.btn--danger {
  background: transparent;
  color: #d08080;
  border: 1px solid rgba(180,80,80,0.25);
  padding: 8px 20px;
  font-size: 13px;
}

.btn--danger:hover {
  background: rgba(180,80,80,0.08);
}

.btn--sm {
  padding: 8px 20px;
  font-size: 13px;
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 20px;
}

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

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--transition);
  direction: rtl;
  outline: none;
}

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

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

.form-input.error {
  border-color: rgba(180,80,80,0.5);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a7870' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
}

.form-error {
  font-size: 12px;
  color: #d08080;
  margin-top: 6px;
  display: none;
}

.form-error.visible {
  display: block;
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

.divider--gold {
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}

/* --- Alert / Message Boxes --- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}

.alert.visible {
  display: block;
}

.alert--error {
  background: rgba(180,80,80,0.08);
  border: 1px solid rgba(180,80,80,0.2);
  color: #d08080;
}

.alert--success {
  background: rgba(80, 180, 120, 0.08);
  border: 1px solid rgba(80, 180, 120, 0.2);
  color: #80d0a0;
}

/* --- Success Screen --- */
.success-screen {
  text-align: center;
  display: none;
}

.success-screen.visible {
  display: block;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 22px;
}

.success-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.success-sub {
  font-size: 14px;
  color: var(--text-muted);
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  height: 16px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Spinner --- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(10,10,11,0.3);
  border-top-color: rgba(10,10,11,0.8);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* --- Page Header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.page-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-header__tag {
  font-size: 11px;
  color: var(--gold);
  background: rgba(201,168,76,0.08);
  border: 1px solid var(--gold-border);
  padding: 2px 10px;
  border-radius: 100px;
  letter-spacing: 0.05em;
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Stats Row --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-card__label {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Settings Panel --- */
.settings-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 32px;
}

.settings-panel__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-row + .settings-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.settings-row__label {
  font-size: 14px;
  color: var(--text-primary);
}

.settings-row__desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Toggle Switch --- */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__track {
  position: absolute;
  inset: 0;
  background: var(--text-subtle);
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle input:checked + .toggle__track {
  background: var(--gold);
}

.toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: var(--transition);
}

.toggle input:checked + .toggle__track::after {
  transform: translateX(-20px);
}

/* --- Capacity Input Row --- */
.capacity-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.capacity-row .form-input {
  width: 100px;
  text-align: center;
}

/* --- Table --- */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.table-header__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.table-header__count {
  font-size: 12px;
  color: var(--gold);
  background: rgba(201,168,76,0.08);
  border: 1px solid var(--gold-border);
  padding: 3px 12px;
  border-radius: 100px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: right;
  padding: 12px 24px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 24px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
  border-bottom: none;
}

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

.data-table .phone-cell {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: right;
  color: var(--text-muted);
}

.data-table .date-cell {
  color: var(--text-subtle);
  font-size: 12px;
  direction: ltr;
  text-align: right;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 32px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state__text {
  font-size: 14px;
}

/* --- Login Screen --- */
.login-screen {
  text-align: center;
}

.login-screen .wordmark {
  margin-bottom: 40px;
}

.login-screen .card {
  text-align: right;
}

.login-screen__subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  text-align: center;
}

/* --- Admin Layout --- */
.admin-layout {
  min-height: 100vh;
  padding: 0 0 64px;
}

/* --- Back Link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--gold);
}

/* --- Loading Overlay --- */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.3s ease;
}

#page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: loader-bounce 1.2s ease-in-out infinite;
}

.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }

.loader-dots {
  display: flex;
  gap: 8px;
}

@keyframes loader-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-10px); opacity: 1; }
}

/* --- Decorative accent line --- */
.accent-line {
  width: 40px;
  height: 2px;
  background: var(--gold);
  margin: 0 auto 28px;
  border-radius: 2px;
  opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .card {
    padding: 28px 22px;
  }

  .wordmark__name {
    font-size: 34px;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 16px;
  }

  /* Hide telegram column on mobile */
  .col-telegram {
    display: none;
  }

  .settings-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
