/* client/public/css/main.css */
/* طراحی مینیمال و حرفه‌ای با تم تاریک */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap');

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --surface: #16161f;
  --surface2: #1e1e2a;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #e8e8f0;
  --text2: #9090a8;
  --text3: #5a5a70;
  --accent: #c8a96e;     /* طلایی */
  --accent2: #a07840;
  --green: #4caf82;
  --red: #e05555;
  --blue: #5b8fe8;
  --spade: #e8e8f0;
  --heart: #e05555;
  --diamond: #e05555;
  --club: #e8e8f0;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
}

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

html { font-size: 15px; }

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   Scrollbar
   ========================================= */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* =========================================
   Typography
   ========================================= */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 500; }

/* =========================================
   Buttons
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { opacity: 0.85; }

.btn-success { background: var(--green); color: white; }
.btn-success:hover { opacity: 0.85; }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* =========================================
   Form
   ========================================= */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 0.82rem; color: var(--text2); font-weight: 500; }

.form-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
  direction: ltr;
  text-align: right;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text3); }

/* =========================================
   Card (پوکر کارت)
   ========================================= */
.playing-card {
  width: 52px;
  height: 74px;
  background: #fff;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  position: relative;
  user-select: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}
.playing-card:hover { transform: translateY(-4px); }
.playing-card.hidden {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 1px solid rgba(255,255,255,0.1);
}
.playing-card.hidden::after {
  content: '🂠';
  font-size: 2.5rem;
  color: rgba(255,255,255,0.15);
}
.card-rank { font-size: 1rem; line-height: 1; }
.card-suit { font-size: 0.9rem; line-height: 1; }
.card-hearts, .card-diamonds { color: #d32f2f; }
.card-spades, .card-clubs { color: #212121; }
.card-rank-top { position: absolute; top: 4px; left: 6px; font-size: 0.75rem; line-height: 1; }
.card-rank-bottom { position: absolute; bottom: 4px; right: 6px; font-size: 0.75rem; line-height: 1; transform: rotate(180deg); }

/* =========================================
   Navbar
   ========================================= */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.navbar-logo span { color: var(--text); }
.navbar-nav { display: flex; align-items: center; gap: 8px; }

/* =========================================
   Page
   ========================================= */
.page { min-height: calc(100vh - 60px); padding: 32px 24px; max-width: 1200px; margin: 0 auto; }
.page-header { margin-bottom: 28px; }
.page-title { font-size: 1.5rem; font-weight: 700; }
.page-subtitle { color: var(--text2); font-size: 0.9rem; margin-top: 4px; }

/* =========================================
   Grid
   ========================================= */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* =========================================
   Card / Panel
   ========================================= */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* =========================================
   Badge
   ========================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-gold { background: rgba(200,169,110,0.15); color: var(--accent); border: 1px solid rgba(200,169,110,0.2); }
.badge-green { background: rgba(76,175,130,0.15); color: var(--green); border: 1px solid rgba(76,175,130,0.2); }
.badge-red { background: rgba(224,85,85,0.15); color: var(--red); border: 1px solid rgba(224,85,85,0.2); }

/* =========================================
   Chip Counter
   ========================================= */
.chips-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid rgba(200,169,110,0.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}
.chips-display::before { content: '🪙'; font-size: 0.85rem; }

/* =========================================
   Alert / Toast
   ========================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
  pointer-events: all;
}
.toast-success { border-color: rgba(76,175,130,0.3); }
.toast-error { border-color: rgba(224,85,85,0.3); color: var(--red); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   Modal
   ========================================= */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 420px;
  max-width: 95vw;
  box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* =========================================
   Loading
   ========================================= */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   Divider
   ========================================= */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text3);
  font-size: 0.8rem;
  margin: 16px 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1;
  border-top: 1px solid var(--border);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
  .page { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .navbar { padding: 0 16px; }

  /* ایمیل یا نام کاربر: ریسپانسیو موبایل */
  #nav-username {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }
}
