/* =====================================================
   SAATDURUM — AUTH GATE, LOGIN/SIGNUP & PROFILE STYLES
   Modern Dark Theme, Firebase Auth Integrated
===================================================== */

/* ═════════════════════════════════════════
   0. APP INITIALIZATION & AUTH SPLASH SCREEN
═════════════════════════════════════════ */
.app-auth-splash {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-main, #08080a);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.app-auth-splash.app-splash-fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.app-splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding: 24px;
  max-width: 320px;
  animation: appSplashPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes appSplashPop {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.app-splash-icon-box {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: var(--bg-card, #121217);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 24px var(--accent-glow, rgba(249, 115, 22, 0.25));
}

.app-splash-icon-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  z-index: 2;
  border-radius: 12px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.app-splash-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 24px;
  border: 2px solid var(--accent, #f97316);
  opacity: 0.4;
  animation: appSplashPulseAnim 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes appSplashPulseAnim {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 0.15; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

.app-splash-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.app-splash-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-p, #ffffff);
  margin: 0;
}

.app-splash-title span {
  color: var(--accent, #f97316);
}

.app-splash-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-s, #94a3b8);
  margin: 0;
  letter-spacing: 0.2px;
}

.app-splash-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.app-splash-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent, #f97316);
  animation: appSplashSpin 0.75s linear infinite;
}

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

.app-splash-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-m, #64748b);
}

:root {
  /* Artık sabit renkler değil, aktif temanın global değişkenlerinden besleniyor. */
  --auth-bg: var(--bg-mid, #09090c);
  --auth-card: var(--bg-card, #121217);
  --auth-card-inner: var(--bg-card-hv, #181822);
  --auth-border: var(--border, rgba(255, 255, 255, 0.08));
  --auth-border-hv: var(--border-hv, rgba(255, 255, 255, 0.2));
  --auth-accent: var(--accent, #f97316);
  --auth-accent-glow: hsla(var(--accent-h, 24), var(--accent-s, 90%), 60%, 0.35);
  --auth-text-p: var(--text-p, #ffffff);
  --auth-text-s: var(--text-s, #94a3b8);
  --auth-text-m: var(--text-m, #64748b);
  --auth-font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;
}

/* Light Theme */
body.theme-light,
body.light-theme,
[data-theme="light"],
body.theme-litewhite,
body.litewhite-theme,
[data-theme="litewhite"] {
  --auth-bg: #f8fafc;
  --auth-card: #ffffff;
  --auth-card-inner: #f1f5f9;
  --auth-border: rgba(15, 23, 42, 0.12);
  --auth-border-hv: rgba(15, 23, 42, 0.22);
  --auth-text-p: #0f172a;
  --auth-text-s: #475569;
  --auth-text-m: #64748b;
}

/* Pink Theme */
body.theme-pink,
body.pink-theme,
[data-theme="pink"] {
  --auth-bg: #fff1f2;
  --auth-card: #ffffff;
  --auth-card-inner: #fff5f7;
  --auth-border: rgba(244, 63, 94, 0.2);
  --auth-border-hv: rgba(244, 63, 94, 0.38);
  --auth-text-p: #4c2f35;
  --auth-text-s: #8a636c;
  --auth-text-m: #9f737d;
}

/* ═════════════════════════════════════════
   1. FULLSCREEN AUTH GATE
═════════════════════════════════════════ */

#auth-gate-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 8, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
  animation: authFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

body.theme-light #auth-gate-container,
body.light-theme #auth-gate-container,
[data-theme="light"] #auth-gate-container,
body.theme-litewhite #auth-gate-container,
body.litewhite-theme #auth-gate-container,
[data-theme="litewhite"] #auth-gate-container {
  background: rgba(244, 244, 244, 0.95);
}

#auth-gate-container.hidden,
#auth-gate-container[style*="display: none"],
#auth-gate-container[style*="display:none"] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-gate-card {
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255,255,255,0.04);
  position: relative;
  pointer-events: auto;
}

body.theme-light .auth-gate-card,
body.light-theme .auth-gate-card,
[data-theme="light"] .auth-gate-card,
body.theme-litewhite .auth-gate-card,
body.litewhite-theme .auth-gate-card,
[data-theme="litewhite"] .auth-gate-card {
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

/* Brand / Logo Block */
.auth-gate-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
}

.auth-gate-logo-wrap {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ea580c, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 10px 30px var(--auth-accent-glow);
  margin-bottom: 2px;
}

.auth-gate-brand-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--auth-text-p);
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1;
}

.auth-gate-brand-title span {
  color: var(--auth-accent);
}

.auth-gate-brand-desc {
  font-size: 13px;
  color: var(--auth-text-s);
  margin: 0;
  line-height: 1.5;
}

.auth-gate-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.auth-gate-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ea580c, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 24px var(--auth-accent-glow);
  margin-bottom: 2px;
}

.auth-gate-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--auth-text-p);
  letter-spacing: -0.02em;
  margin: 0;
}

.auth-gate-title span {
  color: var(--auth-accent);
}

.auth-gate-desc {
  font-size: 13.5px;
  color: var(--auth-text-s);
  margin: 0;
  line-height: 1.45;
}

/* Auth Mode Tabs (Giriş Yap / Kayıt Ol) */
.auth-gate-tabs {
  display: flex;
  background: var(--auth-card-inner);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  padding: 3px;
  gap: 4px;
}

.auth-gate-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--auth-text-s);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-gate-tab-btn.active {
  background: var(--auth-card);
  color: var(--auth-text-p);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Official Google Sign-In Button */
.auth-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.auth-btn-google:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.18);
}

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

.auth-btn-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--auth-text-m);
  font-size: 12px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Form inputs & submit */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-input-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--auth-text-s);
  letter-spacing: 0.05em;
}

.auth-input-wrap {
  position: relative;
  width: 100%;
}

.auth-input {
  width: 100%;
  background: var(--auth-card-inner);
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--auth-text-p);
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.auth-input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px var(--auth-accent-glow);
}

.auth-input::placeholder {
  color: var(--auth-text-m);
  font-weight: 400;
}

.auth-eye-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--auth-text-m);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-eye-toggle:hover {
  color: var(--auth-text-p);
}

.auth-row-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 12px;
}

.auth-link-text {
  color: var(--auth-accent);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.auth-link-text:hover {
  text-decoration: underline;
}

.auth-submit-btn {
  background: linear-gradient(135deg, #ea580c, #f97316);
  border: none;
  border-radius: 12px;
  padding: 13px;
  color: var(--auth-text-p);
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px var(--auth-accent-glow);
  width: 100%;
  margin-top: 4px;
  display: block;
  text-align: center;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 8px 24px var(--auth-accent-glow);
}

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

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-error-badge {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #ef4444;
  display: none;
  line-height: 1.45;
}

/* Guest Mode Button */
.auth-gate-guest-row {
  text-align: center;
  padding-top: 4px;
  border-top: 1px solid var(--auth-border);
}

.auth-guest-btn {
  background: transparent;
  border: none;
  color: var(--auth-text-m);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
  transition: color 0.15s;
}

.auth-guest-btn:hover {
  color: var(--auth-text-s);
}

/* ═════════════════════════════════════════
   2. PROFILE TAB & SETTINGS STYLES
═════════════════════════════════════════ */

.prof-tab-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.prof-header-card {
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.15s;
}

.prof-header-card:hover {
  border-color: var(--auth-border-hv);
}

.prof-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.prof-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  cursor: pointer;
  flex-shrink: 0;
}

.prof-avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--auth-text-p);
  overflow: hidden;
  transition: border-color 0.15s;
}

.prof-avatar-wrap:hover .prof-avatar-img {
  border-color: var(--auth-accent);
}

.prof-avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #272733;
  border: 2px solid var(--auth-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.prof-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prof-display-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--auth-text-p);
}

.prof-handle {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text-m);
  font-family: var(--auth-font-mono);
}

.prof-bio {
  font-size: 13px;
  color: var(--auth-text-s);
  line-height: 1.45;
  margin-top: 2px;
}

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

.prof-badge-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: var(--auth-accent);
}

/* 3 Column Social Stats Card */
.prof-stats-grid {
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 16px;
  padding: 16px 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.prof-stat-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.prof-stat-val {
  font-family: var(--auth-font-mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--auth-text-p);
}

.prof-stat-val.accent {
  color: var(--auth-accent);
}

.prof-stat-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--auth-text-s);
}

/* Action Rows */
.prof-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prof-action-item {
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.prof-action-item:hover {
  background: var(--auth-card-inner);
  border-color: var(--auth-border-hv);
  transform: translateY(-1px);
}

.prof-action-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--auth-text-p);
}

.prof-action-right {
  font-size: 14px;
  color: var(--auth-text-m);
}

.prof-btn-signout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 14px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ef4444;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.prof-btn-signout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  transform: translateY(-1px);
}

/* Avatar Emoji Picker Grid */
.prof-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.prof-avatar-option {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--auth-card-inner);
  border: 1.5px solid var(--auth-border);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.prof-avatar-option:hover {
  border-color: var(--auth-accent);
  background: rgba(249,115,22,0.12);
  transform: scale(1.08);
}

.prof-avatar-option.selected {
  border-color: var(--auth-accent);
  background: rgba(249,115,22,0.2);
  box-shadow: 0 0 0 3px var(--auth-accent-glow);
}

.prof-avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* Profil Fotoğrafı Galerisi (assets/profile/) — sticker drawer'ıyla aynı
   ızgara/etkileşim dilini kullanır, sadece performans için (100+ görsel
   olsa bile sayfa uzamasın) sınırlı yükseklikte kaydırılabilir bir alan. */
.prof-avatar-grid-scroll {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  /* Kaydırma sırasında yeniden çizimi (repaint) komşu içerikle sınırlı
     tutar — çok sayıda küçük görsel olduğunda gereksiz performans
     kaybını azaltır. */
  contain: content;
}

.prof-avatar-grid-scroll::-webkit-scrollbar {
  width: 6px;
}

.prof-avatar-grid-scroll::-webkit-scrollbar-thumb {
  background: var(--auth-border);
  border-radius: 6px;
}

.prof-avatar-gallery-empty {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--auth-text-m);
  padding: 10px 2px;
}

.prof-avatar-gallery-more {
  grid-column: 1 / -1;
  background: transparent;
  border: 1.5px dashed var(--auth-border);
  border-radius: 10px;
  padding: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--auth-text-m);
  cursor: pointer;
  transition: all 0.15s ease;
}

.prof-avatar-gallery-more:hover {
  border-color: var(--auth-accent);
  color: var(--auth-accent);
}

/* Profile display name + bio inside inline auth card */
.profile-hero-card {
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 18px;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

.profile-avatar-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.profile-avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  overflow: hidden;
}

.profile-details {
  flex: 1;
}

.profile-display-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--auth-text-p);
  margin: 0 0 2px 0;
}

.profile-username {
  font-size: 13px;
  color: var(--auth-text-m);
  font-family: var(--auth-font-mono);
  margin: 0 0 6px 0;
}

.profile-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-bio-text {
  font-size: 13px;
  color: var(--auth-text-s);
  line-height: 1.45;
  margin: 12px 0 0 0;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--auth-border);
  text-align: center;
}

.profile-stat-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-stat-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--auth-text-p);
  font-family: var(--auth-font-mono);
}

.profile-stat-lbl {
  font-size: 11px;
  color: var(--auth-text-s);
  font-weight: 600;
}

/* ═════════════════════════════════════════
   PROFILE NOTIFICATION BUTTON
═════════════════════════════════════════ */
.prof-notif-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--auth-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--auth-border, rgba(255, 255, 255, 0.1));
  color: var(--auth-text-p, #ffffff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: 8px;
  padding: 0;
}

.prof-notif-btn:hover {
  background: rgba(249, 115, 22, 0.15);
  border-color: var(--auth-accent, #f97316);
  color: var(--auth-accent, #f97316);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

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