/* ==========================================================================
   Binance-Style Authentication & User Profile Component Styles
   ========================================================================== */

/* ==========================================================================
   1. Navbar User Menu & Role Badges
   ========================================================================== */
.auth-nav-wrap {
  display: flex;
  align-items: center;
  position: relative;
}

.btn-auth-nav {
  background-color: var(--brand-primary-bg);
  color: var(--brand-primary) !important;
  border: 1px solid rgba(240, 185, 11, 0.35);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-auth-nav:hover {
  background-color: var(--brand-primary);
  color: #1E2329 !important;
  border-color: var(--brand-primary);
}

/* User Profile Chip */
.user-chip-wrap {
  position: relative;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 4px 10px 4px 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

html[lang="en"] .user-chip {
  padding: 4px 6px 4px 10px;
}

.user-chip:hover {
  background: var(--bg-surface-alt);
  border-color: var(--border-strong);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #1E2329;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Role Badges */
.role-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.role-badge.free {
  background: rgba(132, 142, 156, 0.15);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.role-badge.premium {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
  box-shadow: 0 0 8px rgba(14, 203, 129, 0.2);
}

.role-badge.admin {
  background: rgba(42, 171, 238, 0.15);
  color: #2AABEE;
  border: 1px solid rgba(42, 171, 238, 0.45);
  box-shadow: 0 0 8px rgba(42, 171, 238, 0.2);
}

.role-badge.founder {
  background: var(--brand-primary-bg);
  color: var(--brand-primary);
  border: 1px solid rgba(240, 185, 11, 0.45);
  box-shadow: 0 0 10px rgba(240, 185, 11, 0.3);
}

/* Dropdown Menu */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 260px;
  background: #1E2329;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
  z-index: 200;
  overflow: hidden;
  display: none;
}

.user-dropdown.show {
  display: block;
}

.dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: #171B20;
}

.dropdown-user-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dropdown-sub-status {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.dropdown-menu-list {
  padding: 6px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary-soft);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: start;
}

.dropdown-item:hover {
  background: var(--bg-surface-alt);
  color: var(--brand-primary);
}

.dropdown-item.admin-link {
  color: var(--brand-primary);
}

.dropdown-item.logout {
  color: var(--danger);
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
}

.dropdown-item.logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ==========================================================================
   2. Auth Modal (Dark Binance Styling)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 490px;
  background: #1E2329;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  animation: modalScaleUp 0.2s ease-out;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  inset-inline-end: 20px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-title-wrap {
  margin-bottom: 20px;
  text-align: start;
}

.modal-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.auth-alert {
  display: none;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 16px;
  text-align: start;
}

.auth-alert.info {
  background: rgba(240, 185, 11, 0.1);
  border: 1px solid rgba(240, 185, 11, 0.4);
  color: var(--text-primary-soft);
}

.auth-alert.info b {
  color: var(--brand-primary);
}

.auth-alert.error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.auth-alert.success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

/* Auth Provider Tabs */
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #121519;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
}

.auth-tab-btn {
  position: relative;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: all var(--transition-fast);
}

.auth-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.auth-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

/* Recommended Tab Highlight */
.auth-tab-btn.tab-recommended {
  border-color: rgba(240, 185, 11, 0.35);
}

.auth-tab-btn.tab-recommended.active {
  border-color: var(--brand-primary);
  background: rgba(240, 185, 11, 0.1);
  color: var(--brand-primary);
}

.tab-badge-rec {
  position: absolute;
  top: -9px;
  background: var(--brand-primary);
  color: #121519;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

/* Tab Panels */
.auth-tab-panel {
  display: none;
}

.auth-tab-panel.active {
  display: block;
}

/* Telegram Connect Box */
.telegram-auth-box {
  background: #15191E;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  margin-bottom: 14px;
}

.telegram-logo-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #2AABEE;
  color: white;
}

.btn-telegram-connect {
  background: #2AABEE;
  color: white !important;
  width: 100%;
  padding: 11px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition-fast);
  margin-top: 10px;
}

.btn-telegram-connect:hover {
  opacity: 0.92;
}

.tg-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 11px;
  margin: 14px 0;
}

.tg-divider::before,
.tg-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.tg-divider span {
  padding: 0 10px;
}

/* Form Groups */
.auth-form-group {
  margin-bottom: 14px;
}

.auth-form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  background: #121519;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  box-sizing: border-box;
  transition: border-color var(--transition-fast);
}

.auth-input:focus {
  border-color: var(--brand-primary);
  outline: none;
}

.auth-toggle-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.auth-toggle-mode a {
  color: var(--brand-primary);
  font-weight: 700;
  cursor: pointer;
}

/* Web3 Wallet Box */
.wallet-auth-box {
  background: #15191E;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px 18px;
  text-align: center;
}

.wallet-logo-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(240, 185, 11, 0.15);
  color: var(--brand-primary);
}

/* ==========================================================================
   3. Admin Management Panel Modal
   ========================================================================== */
.admin-modal-card {
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.admin-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
  max-height: 55vh;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: start;
}

.admin-table th {
  background: #15191E;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  white-space: nowrap;
}

.admin-table tr:hover td {
  background: var(--bg-surface-hover);
}

.admin-action-btn {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  border: 1px solid transparent;
  margin-inline-end: 4px;
  font-weight: 600;
}

.admin-action-btn.vip {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.admin-action-btn.free {
  background: rgba(132, 142, 156, 0.15);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.admin-action-btn.days {
  background: var(--brand-primary-bg);
  color: var(--brand-primary);
  border-color: rgba(240, 185, 11, 0.35);
}

/* ==========================================================================
   4. Discord-Style Avatar & Badge System
   ========================================================================== */
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #1E2329;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar .avatar-emoji {
  line-height: 1;
  font-size: 14px;
}

/* Inline Discord Badges Rack */
.badge-rack {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.discord-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  cursor: default;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}

.discord-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.discord-badge-icon {
  font-size: 11px;
  line-height: 1;
}

/* ==========================================================================
   5. Discord-Style Profile Customization Modal
   ========================================================================== */
.profile-modal-card {
  max-width: 480px;
  padding: 0 !important;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
}

.profile-modal-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 14px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  border: none;
  font-size: 18px;
  line-height: 1;
  transition: background var(--transition-fast);
}

.profile-modal-close:hover {
  background: rgba(0, 0, 0, 0.85);
}

.discord-card-preview {
  background: #181D24;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.discord-banner {
  height: 85px;
  background: linear-gradient(135deg, #1E2329 0%, #2B3139 100%);
  position: relative;
  transition: background 0.3s ease;
}

.discord-avatar-wrap {
  position: absolute;
  bottom: -30px;
  inset-inline-start: 20px;
}

.discord-avatar-large {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 4px solid #181D24;
  background: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  position: relative;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.discord-avatar-large:hover {
  transform: scale(1.05);
}

.discord-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discord-status-dot {
  position: absolute;
  bottom: 2px;
  inset-inline-end: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #23A55A;
  border: 3px solid #181D24;
}

.discord-profile-details {
  padding: 38px 20px 16px;
}

.discord-names {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.discord-username {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.discord-handle {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.discord-badges-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.discord-bio-preview {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 32px;
}

/* Modal Body Form */
.profile-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-surface);
  max-height: 48vh;
  overflow-y: auto;
}

.avatar-presets-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.avatar-preset-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-alt);
  border: 2px solid transparent;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.avatar-preset-btn:hover {
  transform: scale(1.1);
  border-color: rgba(240, 185, 11, 0.4);
}

.avatar-preset-btn.active {
  border-color: var(--brand-primary);
  background: rgba(240, 185, 11, 0.15);
  box-shadow: 0 0 10px rgba(240, 185, 11, 0.3);
}

.color-swatches-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: #FFFFFF;
  box-shadow: 0 0 8px currentColor;
  transform: scale(1.1);
}

.btn-random-avatar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-random-avatar:hover {
  background: var(--brand-primary);
  color: #121519;
  border-color: var(--brand-primary);
  transform: translateY(-1px);
}

.dice-icon {
  transition: transform 0.3s ease;
  display: inline-block;
}

.btn-random-avatar:active .dice-icon {
  transform: rotate(180deg);
}

.profile-modal-footer {
  padding: 12px 20px;
  background: var(--bg-surface-alt);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
