/* ============================================================
   VnStock Auth — Login Overlay & User Info Styles
   Tích hợp với Tailwind dark theme của Phase 1
   ============================================================ */

/* ── Auth Overlay (full-screen, trên tất cả) ── */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.93);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#auth-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Auth Card ── */
.auth-card {
  background: rgba(49, 53, 60, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2.75rem 2.5rem;
  width: 420px;
  max-width: 92vw;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(0, 226, 147, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.55);
  animation: authSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authSlideUp {
  from { transform: translateY(28px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.auth-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}
.auth-logo-icon {
  width: 36px;
  height: 36px;
  background: #00e293;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #00e293;
  margin: 0;
  font-family: 'Manrope', sans-serif;
  letter-spacing: -0.04em;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 0.25rem 0 2.25rem;
  line-height: 1.5;
}

/* ── Error message ── */
#auth-error-msg {
  display: none;
  margin-bottom: 1rem;
  padding: 0.625rem 1rem;
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 80, 80, 0.25);
  border-radius: 10px;
  color: #ff8080;
  font-size: 0.82rem;
}

/* ── Google Button ── */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  padding: 0.9rem 1.5rem;
  background: #fff;
  color: #1f1f1f;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    box-shadow 0.2s ease,
    transform 0.15s ease,
    opacity 0.2s ease;
  font-family: 'Inter', sans-serif;
  position: relative;
}
.btn-google:hover {
  box-shadow: 0 4px 24px rgba(66, 133, 244, 0.32);
  transform: translateY(-1px);
}
.btn-google:active {
  transform: translateY(0);
}
.btn-google.loading {
  opacity: 0.65;
  pointer-events: none;
}
.btn-google .btn-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.btn-google.loading .btn-spinner { display: block; }
.btn-google.loading .btn-google-icon { display: none; }

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

.btn-google-icon {
  flex-shrink: 0;
}

/* ── TOS text ── */
.auth-tos {
  margin-top: 1.5rem;
  font-size: 0.775rem;
  color: rgba(255, 255, 255, 0.28);
  line-height: 1.6;
}

/* ────────────────────────────────────────────────
   Header User Info (injected into existing sidebar)
   ──────────────────────────────────────────────── */
.sidebar-user-section {
  padding: 1rem 1rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.sidebar-user-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 226, 147, 0.3);
  flex-shrink: 0;
}
.sidebar-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e293, #006c44);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: #003921;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.sidebar-user-email {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.sidebar-settings-icon {
  font-size: 0.9rem;
  opacity: 0.45;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.sidebar-user-link:hover .sidebar-settings-icon { opacity: 0.9; }

/* ────────────────────────────────────────────────
   Settings / Profile Screen
   ──────────────────────────────────────────────── */
.settings-screen {
  padding: 2.5rem 2rem;
  max-width: 540px;
  margin: 0 auto;
}

.settings-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: rgba(255,255,255,0.65);
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.btn-back:hover { background: rgba(255,255,255,0.1); color: #fff; }

.settings-page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin: 0;
}

/* Profile Card */
.settings-profile-card {
  background: rgba(49, 53, 60, 0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.25rem;
  position: relative;
}

.settings-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1.125rem;
}
.settings-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(0, 226, 147, 0.2);
}
.settings-avatar-placeholder {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e293, #006c44);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; font-weight: 800; color: #003921;
}
.settings-google-badge {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  color: #4285F4;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(16, 20, 26, 0.8);
}

.settings-user-name  {
  font-size: 1.2rem; font-weight: 700;
  color: rgba(255,255,255,0.95);
  margin: 0 0 0.25rem;
  font-family: 'Manrope', sans-serif;
}
.settings-user-email {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  margin: 0;
}

/* Info Card */
.settings-info-card {
  background: rgba(49, 53, 60, 0.35);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 0.25rem 1.25rem;
  margin-bottom: 1.25rem;
}
.settings-info-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.settings-info-row:last-child { border-bottom: none; }
.settings-info-icon { font-size: 1.05rem; flex-shrink: 0; width: 1.5rem; text-align: center; }
.settings-info-label { font-size: 0.72rem; color: rgba(255,255,255,0.38); margin-bottom: 0.15rem; }
.settings-info-value { font-size: 0.875rem; color: rgba(255,255,255,0.82); font-weight: 500; }

/* Logout Button */
.btn-logout {
  width: 100%;
  padding: 0.9rem;
  background: rgba(255, 70, 70, 0.1);
  border: 1px solid rgba(255, 70, 70, 0.22);
  border-radius: 14px;
  color: #ff7575;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s, border-color 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-logout:hover {
  background: rgba(255, 70, 70, 0.18);
  border-color: rgba(255, 70, 70, 0.45);
}
.btn-logout:disabled { opacity: 0.45; cursor: not-allowed; }
