/* ══════════════════════════════════════════════════════════════════
   BERK MAIL — DUAL THEME ENGINE (RED MASTER ADMIN & PINK USER INBOX)
   ══════════════════════════════════════════════════════════════════ */
:root {
  --bg: #0b0c10;
  --bg-card: rgba(18, 19, 26, 0.78);
  --bg-card-hover: rgba(28, 29, 40, 0.88);
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-muted: #8e8ea0;
  --radius-pill: 9999px;
  --radius-card: 16px;
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Figtree', sans-serif;

  /* Varsayılan Tema: Kırmızı Master Admin */
  --accent: #ff3344;
  --accent-glow: rgba(255, 51, 68, 0.35);
  --accent-bright: #ff5263;
  --amb-color: rgba(235, 35, 55, 0.22);
}

/* PEMBE TEMA (MÜŞTERİ / KULLANICI ARAYÜZÜ) */
body.theme-pink {
  --accent: #ec4899;
  --accent-glow: rgba(236, 72, 153, 0.35);
  --accent-bright: #f472b6;
  --amb-color: rgba(236, 72, 153, 0.22);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Görünmez Kaydırma Çubuğu (No Scrollbar) */
.no-scrollbar::-webkit-scrollbar,
::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.no-scrollbar,
body, html {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambiyans Işık Efekti */
.amb {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 650px;
  background: radial-gradient(circle 900px at 50% -150px, var(--amb-color), transparent 75%);
  pointer-events: none;
  z-index: 0;
  animation: pulseAmbient 8s ease-in-out infinite alternate;
}

@keyframes pulseAmbient {
  0% { opacity: 0.75; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* Cursor Glow Dinamik Işıklandırma */
.glow-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.glow-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(500px circle at var(--x, 50%) var(--y, 50%), var(--accent-glow), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
  z-index: 1;
}

.glow-card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 30px -10px var(--accent-glow);
}

.glow-card:hover::before {
  opacity: 1;
}

/* ═══════════ GENEL PİLL BUTONLAR ═══════════ */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.pill-btn:active {
  transform: scale(0.96);
}

.pill-btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px var(--accent-glow);
}

.pill-btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 24px var(--accent-glow);
  transform: translateY(-1px);
}

.pill-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

.pill-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
}

.pill-btn-danger {
  background: rgba(255, 51, 68, 0.1);
  border: 1px solid rgba(255, 51, 68, 0.25);
  color: #ff6b7a;
}

.pill-btn-danger:hover {
  background: rgba(255, 51, 68, 0.2);
  border-color: rgba(255, 51, 68, 0.5);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 51, 68, 0.3);
}

.pill-btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-pill);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.icon-btn-danger:hover {
  background: rgba(255, 51, 68, 0.25);
  border-color: #ff3344;
  color: #ff4d5e;
}

/* ═══════════ GİRİŞ EKRANLARI (USER & ADMIN) ═══════════ */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  z-index: 10;
  animation: fadeInAuth 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInAuth {
  0% { opacity: 0; transform: scale(0.94) translateY(20px); filter: blur(6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

.auth-box {
  width: 100%;
  max-width: 440px;
  padding: 44px 36px;
  background: rgba(14, 15, 22, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 50px -10px var(--accent-glow);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.auth-mark {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-glow), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px var(--accent-glow);
  animation: pulseLogo 3s infinite alternate ease-in-out;
}

@keyframes pulseLogo {
  0% { box-shadow: 0 0 15px var(--accent-glow); }
  100% { box-shadow: 0 0 35px var(--accent-glow); }
}

.auth-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.auth-title b {
  color: var(--accent);
}

.auth-sub {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  text-align: center;
  letter-spacing: 0.5px;
}

.auth-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ═══════════ ANA UYGULAMA VE TOPBAR ═══════════ */
.app-container {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 5;
  animation: appAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes appAppear {
  0% { opacity: 0; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-glow);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.brand-text span {
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: livePing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes livePing {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 12px #10b981; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* ═══════════ GÖVDE & GRID (KOMPAKT VE DENGELİ) ═══════════ */
.main-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* DASHBOARD */
.compact-dashboard {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.dash-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.dash-title-group h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-stats-bar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text-muted);
}
.dash-stat-item b {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 13px;
}

/* GRID */
.inbox-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

/* TEKİL KULLANICI GÖRÜNÜMÜNDE GRID TEK KOLON OLUR */
.single-inbox-grid {
  display: block;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

/* SOL PANEL */
.sidebar-panel {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 200px);
  min-height: 480px;
  position: sticky;
  top: 84px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.address-scroll-container {
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.address-item {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.address-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--accent);
}

.address-item.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.address-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.address-text {
  font-weight: 600;
  font-size: 13px;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.address-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.pass-display {
  font-family: monospace;
  font-size: 11px;
  color: var(--accent-bright);
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 6px;
  border-radius: 6px;
  user-select: all;
}

.address-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* SAĞ PANEL — MESAJ AKIŞI */
.stream-panel {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 200px);
  min-height: 480px;
}

.stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.stream-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stream-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.filter-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.messages-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  padding-right: 2px;
}

.message-card {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.message-card.unread {
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

.msg-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.msg-sender {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13px;
  color: #ffffff;
}

.sender-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-bright);
}

.msg-time {
  font-size: 11px;
  color: var(--text-muted);
}

.msg-subject {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.msg-snippet {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.msg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #6c6c80;
  padding-top: 4px;
}

.msg-to-tag {
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.empty-box {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* ═══════════ DETAY MODAL ═══════════ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal-box {
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  background: #111218;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), 0 0 50px var(--accent-glow);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-title-group h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.modal-meta-row {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-body-content {
  padding: 24px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: #e0e0e6;
  word-break: break-word;
}

.verification-link-box {
  margin: 16px 24px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--accent);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verification-link-box a {
  color: var(--accent-bright);
  word-break: break-all;
  font-family: monospace;
  font-size: 13px;
}

/* ═══════════ TOAST ═══════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  background: rgba(18, 19, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.toast.error {
  border-color: rgba(255, 51, 68, 0.4);
  box-shadow: 0 0 20px rgba(255, 51, 68, 0.25);
}

@keyframes toastIn {
  0% { transform: translateY(20px) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes toastOut {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(20px) scale(0.9); opacity: 0; }
}

@media (max-width: 900px) {
  .inbox-grid {
    grid-template-columns: 1fr;
  }
  .sidebar-panel {
    position: static;
    max-height: 350px;
  }
  .topbar {
    padding: 0 16px;
  }
  .main-wrapper {
    padding: 16px;
  }
}
