/* ═══════════════════════════════════════════════
   FiveM CAD — Community picker (home) styles
   ═══════════════════════════════════════════════ */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

html, body { min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans); }

/* ── Top nav ── */
.nav {
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--border2);
  display: flex; align-items: center; padding: 0 32px; gap: 16px;
  position: sticky; top: 0; z-index: 10;
}
.nav-brand { font-size: 17px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px; }
.nav-brand-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 3px;
}
.nav-user {
  margin-left: auto; display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-dim);
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--raised); border: 1px solid var(--border2); object-fit: cover;
}
.nav-logout {
  background: none; border: 1px solid var(--border2); color: var(--text-faint);
  padding: 5px 12px; border-radius: 3px; cursor: pointer; font-size: 12px;
  font-family: var(--sans); transition: color 0.15s, border-color 0.15s;
}
.nav-logout:hover { color: var(--text); border-color: var(--border2); }

/* ── Page body ── */
.page { max-width: 860px; margin: 0 auto; padding: 48px 24px; }

.page-header  { margin-bottom: 36px; }
.page-title   { font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.page-subtitle { font-size: 14px; color: var(--text-dim); line-height: 1.6; }

/* ── Community grid ── */
.community-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 36px;
}

.community-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none; display: flex; flex-direction: column;
  position: relative;
}
.community-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(59,130,246,0.15);
}
.community-card-accent { height: 3px; background: var(--accent); flex-shrink: 0; }
.community-card-logo {
  height: 120px; background: var(--raised); display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.community-card-logo img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.community-card-logo-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-faint);
}
.community-card-logo-placeholder .icon {
  width: 48px; height: 48px; background: var(--panel); border-radius: 8px;
  border: 1px solid var(--border2); display: flex; align-items: center;
  justify-content: center; font-size: 22px;
}
.community-card-body { padding: 16px; flex: 1; }
.community-card-name {
  font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.community-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px;
}
.role-owner  { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.role-admin  { background: rgba(59,130,246,0.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.role-member { background: rgba(100,116,139,0.12); color: #94a3b8; border: 1px solid var(--border); }
.code-badge  {
  font-family: var(--mono); font-size: 11px; color: var(--text-faint);
  padding: 2px 6px; background: var(--raised); border-radius: 3px;
}
.community-card-enter {
  position: absolute; bottom: 14px; right: 14px;
  font-size: 11px; font-weight: 600; color: var(--accent);
  opacity: 0; transition: opacity 0.15s;
}
.community-card:hover .community-card-enter { opacity: 1; }

/* ── Seller card ── */
.seller-card {
  background: var(--panel); border: 1px solid rgba(251,191,36,0.3);
  border-radius: 6px; overflow: hidden;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none; display: flex; flex-direction: column;
  position: relative;
}
.seller-card:hover {
  border-color: #fbbf24; transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(251,191,36,0.12);
}
.seller-card-accent { height: 3px; background: linear-gradient(90deg,#f59e0b,#fbbf24); flex-shrink: 0; }
.seller-card-icon {
  height: 120px; background: rgba(251,191,36,0.05);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid rgba(251,191,36,0.15); flex-shrink: 0;
}
.seller-card-enter {
  position: absolute; bottom: 14px; right: 14px;
  font-size: 11px; font-weight: 600; color: #fbbf24;
  opacity: 0; transition: opacity 0.15s;
}
.seller-card:hover .seller-card-enter { opacity: 1; }

/* ── Join section ── */
.join-section {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; padding: 28px 32px;
}
.join-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.join-desc  { font-size: 13px; color: var(--text-dim); margin-bottom: 18px; line-height: 1.6; }
.join-row   { display: flex; gap: 10px; align-items: center; }
.join-input {
  flex: 1; height: 42px; background: var(--raised); border: 1px solid var(--border2);
  color: var(--text); font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0 14px; outline: none; border-radius: 3px;
  transition: border-color 0.15s;
}
.join-input:focus { border-color: var(--accent); }
.join-input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--sans); color: var(--text-faint); font-size: 13px; }
.join-btn {
  height: 42px; padding: 0 20px; background: var(--accent); color: #fff;
  border: none; font-family: var(--sans); font-size: 13px; font-weight: 600;
  cursor: pointer; border-radius: 3px; white-space: nowrap; transition: background 0.15s;
}
.join-btn:hover    { background: var(--accent-h); }
.join-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.join-alert {
  margin-top: 10px; padding: 10px 14px; border-radius: 3px; font-size: 13px;
  display: none;
}
.join-alert.error   { background: var(--red-soft);   color: #f87171; border: 1px solid rgba(229,62,62,0.3); }
.join-alert.success { background: var(--green-soft); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
.join-alert.show    { display: block; }

/* ── Setup Required badge ── */
.setup-required-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px;
  background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.35);
}
.community-card.needs-setup .community-card-accent {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.community-card.needs-setup:hover {
  border-color: #fbbf24;
  box-shadow: 0 8px 32px rgba(251,191,36,0.12);
}
.community-card.needs-setup .community-card-enter { color: #fbbf24; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-faint); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ── Spinner ── */
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border2);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin: 48px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 600px) {
  .nav { padding: 0 16px; gap: 8px; }
  .nav-brand { font-size: 15px; }
  .nav-brand-badge { font-size: 9px; padding: 2px 6px; }
  .page { padding: 32px 16px; }
  .page-title { font-size: 22px; }
  .join-section { padding: 20px 20px; }
  .join-row { flex-direction: column; }
  .join-input { width: 100%; }
  .join-btn { width: 100%; text-align: center; }
}

@media (max-width: 400px) {
  .nav { padding: 0 12px; height: 48px; }
  .page { padding: 24px 12px; }
  .community-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 20px; }
}

/* ── 2FA security section ── */
#security-section { margin-bottom: 36px; }

.security-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border2); border-radius: 6px; padding: 18px 22px;
}
.security-card-left { flex: 1; min-width: 200px; }
.security-card-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.security-card-sub { font-size: 12px; color: var(--text-faint); line-height: 1.5; }

.twofa-active-badge {
  display: inline-block; font-size: 11px; font-weight: 600; color: #4ade80;
  background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.3);
  border-radius: 3px; padding: 1px 8px; margin-left: 8px; vertical-align: middle;
}

.security-btn {
  height: 34px; padding: 0 16px; border-radius: 3px; font-family: var(--sans);
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.4); color: #818cf8;
  transition: background 0.15s, border-color 0.15s;
}
.security-btn:hover { background: rgba(99,102,241,0.25); border-color: rgba(99,102,241,0.6); }
.security-btn.danger { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.35); color: #f87171; }
.security-btn.danger:hover { background: rgba(248,113,113,0.2); border-color: rgba(248,113,113,0.5); }

.security-setup-panel {
  background: var(--panel); border: 1px solid var(--border2); border-top: none;
  border-radius: 0 0 6px 6px; padding: 20px 22px;
}

/* ── Footer ── */
.home-footer {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 860px; margin: 0 auto; padding: 20px 24px 32px;
  border-top: 1px solid var(--border); gap: 12px;
}
.home-footer-brand { font-size: 12px; color: var(--text-faint); }
.home-footer-discord {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: #7289da;
  text-decoration: none; padding: 6px 14px;
  border: 1px solid rgba(114,137,218,0.3); border-radius: 3px;
  transition: background 0.15s, border-color 0.15s;
}
.home-footer-discord:hover {
  background: rgba(114,137,218,0.1); border-color: rgba(114,137,218,0.6);
}
@media (max-width: 480px) {
  .home-footer { flex-direction: column; align-items: flex-start; padding: 16px 16px 24px; }
}
