/*
 * Komşu — "Huzur" teması
 * Mavi ağırlıklı, yumuşak geçişli, sakin bir arayüz katmanı.
 * Tüm sayfalar bu dosyayı en son yükler; renk değişkenlerini ezer ve
 * ortak geçiş/animasyon davranışını ekler.
 */

:root {
  /* Zemin: gece mavisi → derin deniz */
  --bg: #0a1626;
  --bg-2: #0d1d31;
  --panel: #12233a;
  --panel-2: #16293f;
  --panel-3: #1b3350;

  /* Metin */
  --ink: #eaf2fb;
  --muted: #93aac4;

  /* Çizgi ve gölge */
  --line: #223a55;
  --line-soft: rgba(120, 170, 220, 0.14);
  --shadow: 0 18px 48px rgba(3, 12, 24, 0.45);
  --shadow-glow: 0 0 0 1px rgba(110, 190, 255, 0.12), 0 20px 60px rgba(6, 20, 38, 0.55);

  /* Vurgu: sakin gök mavisi */
  --green: #6ec1ff;
  /* eski "yeşil" vurgu artık mavi */
  --green-dark: #06121f;
  --mint: #1b3a5c;
  --yellow: #a8d8ff;
  /* ikincil vurgu: buz mavisi */
  --coral: #ff9d8a;
  /* uyarı tonu korunur, yumuşatıldı */

  /* Yeni tema değişkenleri */
  --accent: #6ec1ff;
  --accent-2: #4a9fe0;
  --accent-soft: rgba(110, 193, 255, 0.12);
  --accent-line: rgba(110, 193, 255, 0.38);
  --calm: #8fcaff;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Zemin: yavaşça nefes alan mavi ışık ---------- */
html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(74, 159, 224, 0.16), transparent 60%),
    radial-gradient(900px 600px at 92% 8%, rgba(110, 193, 255, 0.10), transparent 55%),
    radial-gradient(800px 800px at 50% 110%, rgba(143, 202, 255, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, #081120 100%);
  background-attachment: fixed;
  color: var(--ink);
  transition: background-color 0.6s var(--ease-soft), color 0.4s var(--ease-soft);
}

/* Yumuşak ışık halkaları — sayfanın arkasında çok yavaş hareket eder */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(110, 193, 255, 0.10), transparent 70%) 20% 30% / 45% 45% no-repeat,
    radial-gradient(closest-side, rgba(143, 202, 255, 0.08), transparent 70%) 80% 70% / 40% 40% no-repeat;
  animation: huzur-drift 26s var(--ease-soft) infinite alternate;
  will-change: transform;
}

@keyframes huzur-drift {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }

  to {
    transform: translate3d(3%, 2%, 0) scale(1.08);
  }
}

/* ---------- Kartlar: cam etkisi + yumuşak yükselme ---------- */
.card,
.panel,
.person,
.dues-card,
.chat-area,
.dues-info,
.topbar,
.stat,
.hero-card,
.address-card,
.contact-dialog,
.resident-modal-card {
  background: linear-gradient(160deg, rgba(22, 41, 63, 0.92), rgba(15, 30, 48, 0.88));
  border-color: var(--line);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  transition:
    transform 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    border-color 0.35s var(--ease-soft),
    background 0.45s var(--ease-soft);
}

.card:hover,
.person:hover,
.dues-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-glow);
}

/* ---------- Bağlantılar ve düğmeler ---------- */
a {
  transition: color 0.25s var(--ease-soft), opacity 0.25s var(--ease-soft);
}

.nav a,
.logout,
.chat-return,
.back {
  transition:
    background 0.3s var(--ease-soft),
    border-color 0.3s var(--ease-soft),
    color 0.3s var(--ease-soft),
    transform 0.3s var(--ease);
}

.nav a:hover,
.logout:hover,
.chat-return:hover {
  transform: translateY(-1px);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.nav a.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  box-shadow: inset 0 0 0 1px rgba(110, 193, 255, 0.12);
}

button,
.btn,
.chat-send,
.family-submit {
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.3s var(--ease),
    background 0.3s var(--ease-soft),
    border-color 0.3s var(--ease-soft),
    color 0.3s var(--ease-soft);
}

button:hover:not(:disabled),
.btn:hover:not(:disabled),
.chat-send:hover:not(:disabled),
.family-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(74, 159, 224, 0.28);
}

button:active:not(:disabled),
.btn:active:not(:disabled),
.chat-send:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- Form alanları ---------- */
input,
textarea,
select {
  background: rgba(9, 20, 34, 0.75);
  border-color: var(--line);
  color: var(--ink);
  transition:
    border-color 0.3s var(--ease-soft),
    box-shadow 0.3s var(--ease-soft),
    background 0.3s var(--ease-soft);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 193, 255, 0.16);
  background: rgba(12, 26, 43, 0.9);
}

input::placeholder,
textarea::placeholder {
  color: rgba(147, 170, 196, 0.65);
}

/* ---------- Sohbet baloncukları ---------- */
.chat-bubble {
  transition: background 0.35s var(--ease-soft), border-color 0.35s var(--ease-soft), transform 0.35s var(--ease);
}

.chat-message {
  animation: huzur-rise 0.5s var(--ease) both;
}

@keyframes huzur-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.speaking .chat-bubble {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(110, 193, 255, 0.14);
  animation: huzur-breathe 2.4s var(--ease-soft) infinite;
}

@keyframes huzur-breathe {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(110, 193, 255, 0.10);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(110, 193, 255, 0.04);
  }
}

/* ---------- Sayfa girişi: içerik yumuşakça belirir ---------- */
.page>*,
.shell>* {
  animation: huzur-fade-up 0.7s var(--ease) both;
}

.page>*:nth-child(2) {
  animation-delay: 0.06s;
}

.page>*:nth-child(3) {
  animation-delay: 0.12s;
}

.page>*:nth-child(4) {
  animation-delay: 0.18s;
}

.page>*:nth-child(5) {
  animation-delay: 0.24s;
}

.page>*:nth-child(n+6) {
  animation-delay: 0.3s;
}

@keyframes huzur-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Kaydırma çubuğu ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(9, 20, 34, 0.6);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-2), #2c6ea8);
  border-radius: 999px;
  border: 2px solid rgba(9, 20, 34, 0.6);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ---------- Seçim rengi ---------- */
::selection {
  background: rgba(110, 193, 255, 0.28);
  color: #ffffff;
}

/* ---------- Hareket azaltma tercihi ---------- */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  body::before {
    animation: none;
  }
}