/* ══════════════════════════════════════════════════════════════════
   BERK MAIL — ULTRA MODERN CYBERNETIC RED THEME & ADVANCED ANIMATIONS
   ══════════════════════════════════════════════════════════════════ */
:root {
  --bg: #0b0c10;
  --bg-card: rgba(18, 19, 26, 0.75);
  --bg-card-hover: rgba(28, 29, 40, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 59, 48, 0.45);
  --text-primary: #ffffff;
  --text-muted: #8e8ea0;
  --accent-red: #ff3344;
  --accent-red-glow: rgba(255, 51, 68, 0.35);
  --accent-red-bright: #ff5263;
  --accent-green: #10b981;
  --radius-pill: 9999px;
  --radius-card: 16px;
  --radius-sm: 10px;
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Figtree', sans-serif;
}

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

/* Scrollbar Gizleme (Tüm Tarayıcılar İçin) */
.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 Kırmızı Işık Efekti */
.amb {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 650px;
  background: radial-gradient(circle 900px at 50% -150px, rgba(235, 35, 55, 0.22), 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%), rgba(255, 51, 68, 0.16), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
  z-index: 1;
}

.glow-card:hover {
  border-color: rgba(255, 51, 68, 0.38);
  box-shadow: 0 10px 30px -10px rgba(255, 51, 68, 0.2);
}

.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, #ff2a3d 0%, #d81428 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(235, 35, 55, 0.4);
}

.pill-btn-primary:hover {
  background: linear-gradient(135deg, #ff3d50 0%, #eb192f 100%);
  box-shadow: 0 6px 24px rgba(235, 35, 55, 0.6);
  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: var(--accent-red);
  color: #ff4d5e;
}

/* ═══════════ AUTH EKRANI ═══════════ */
#viewAuth {
  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.82);
  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 rgba(255, 42, 61, 0.25);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

@keyframes pulseLogo {
  0% { box-shadow: 0 0 15px rgba(255, 42, 61, 0.2); }
  100% { box-shadow: 0 0 35px rgba(255, 42, 61, 0.6); }
}

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

.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-red);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 20px rgba(255, 42, 61, 0.3);
}

/* ═══════════ ANA UYGULAMA DÜZENİ ═══════════ */
#appView {
  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); }
}

/* ÜST BAR */
.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, 42, 61, 0.15);
  border: 1px solid rgba(255, 42, 61, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(255, 42, 61, 0.25);
}

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

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

/* Sitedeki Canlı Durum Noktası */
.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; }
}

/* ═══════════ İÇERİK IZGARASI (GRID) ═══════════ */
.main-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ZARİF & KOMPAKT DASHBOARD HEADER */
.compact-dashboard {
  padding: 18px 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: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.dash-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  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;
}

.dash-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ÇİFT KOLON GÖVDE (SOL: ADRESLER, SAĞ: GELEN KUTUSU) */
.inbox-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 20px;
  align-items: start;
}

/* SOL PANEL — ADRES LİSTESİ (SAYFAYI ASLA AŞAĞI KAYDIRMAZ, KENDİ İÇİNDE KAYAR) */
.sidebar-panel {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 200px);
  min-height: 480px;
}

.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);
}

/* Adres Listesi Konteyneri: Sayfayı uzatmaz, fare tekerleğiyle bağımsız kayar */
.address-scroll-container {
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.address-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.address-item:hover {
  background: rgba(255, 51, 68, 0.08);
  border-color: rgba(255, 51, 68, 0.25);
  transform: translateX(3px);
}

.address-item.active {
  background: rgba(255, 51, 68, 0.14);
  border-color: rgba(255, 51, 68, 0.45);
  box-shadow: 0 0 15px rgba(255, 51, 68, 0.2);
}

.address-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 2px;
}

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

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

.address-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Silinme Animasyonu */
.deleting-animate {
  animation: shrinkFadeOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes shrinkFadeOut {
  0% { transform: scale(1) translateX(0); opacity: 1; max-height: 60px; margin-bottom: 6px; }
  50% { transform: scale(0.9) translateX(-20px); opacity: 0.3; background: rgba(255, 51, 68, 0.3); }
  100% { transform: scale(0.7) translateX(-40px); opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; }
}

/* Yeni E-posta / Kutu Ekleme Animasyonu */
.new-item-animate {
  animation: slideInDownGlow 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInDownGlow {
  0% { opacity: 0; transform: translateY(-15px) scale(0.96); box-shadow: 0 0 25px rgba(255, 51, 68, 0.7); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* SAĞ PANEL — E-POSTA AKIŞI (KOMPAKT & AKICI) */
.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);
}

/* E-POSTA LİSTE KONTEYNERİ (BAĞIMSIZ DİKEY KAYDIRMA, TAŞMA YAPMAZ) */
.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;
  position: relative;
}

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

.message-card.unread {
  border-left: 3px solid var(--accent-red);
  background: rgba(255, 51, 68, 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, 51, 68, 0.2);
  border: 1px solid rgba(255, 51, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ff5263;
}

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

.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);
}

/* BOŞ MESAJ EKRANI */
.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 (AÇILMA ANİMASYONU) ═══════════ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  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 rgba(255, 42, 61, 0.15);
  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 0;
  padding: 16px;
  background: rgba(255, 51, 68, 0.08);
  border: 1px solid rgba(255, 51, 68, 0.3);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verification-link-box a {
  color: #ff5263;
  word-break: break-all;
  font-family: monospace;
  font-size: 13px;
}

/* ═══════════ TOAST BİLDİRİMLERİ ═══════════ */
.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; }
}

/* Responsive Düzen */
@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;
  }
}
