/*
 * Komşu — "Huzur" etkileşim katmanı.
 * Gezinmeyi akıcı ve keyifli kılan mikro animasyonlar, ikon stilleri ve
 * dokunma/hover geri bildirimleri. huzur-theme.css'ten sonra yüklenir.
 */

/* ---------- Kenar çubuğu ikonları ---------- */
.nav-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 0;
  transition:
    background 0.3s var(--ease-soft),
    transform 0.35s var(--ease),
    color 0.3s var(--ease-soft);
}

.nav-svg {
  width: 17px;
  height: 17px;
  transition: transform 0.35s var(--ease);
}

.nav a:hover .nav-icon {
  background: var(--accent-soft);
  transform: translateX(2px);
}

.nav a:hover .nav-svg {
  transform: scale(1.08);
}

.nav a.active .nav-icon {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.nav a.active {
  position: relative;
}

/* Aktif sayfa göstergesi: solda ince ışık çubuğu */
.nav a.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(110, 193, 255, 0.55);
  animation: huzur-slide-in 0.4s var(--ease) both;
}

@keyframes huzur-slide-in {
  from { opacity: 0; transform: translateY(-50%) scaleY(0.3); }
  to   { opacity: 1; transform: translateY(-50%) scaleY(1); }
}

/* ---------- Stat kartları ---------- */
.stat {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.3s var(--ease-soft), box-shadow 0.4s var(--ease);
}

.stat::after {
  content: "";
  position: absolute;
  inset: -60% -30% auto auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 193, 255, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft), transform 0.6s var(--ease);
  pointer-events: none;
}

.stat:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
}

.stat:hover::after {
  opacity: 1;
  transform: translate(8px, 8px);
}

.stat strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------- Hızlı işlem kutuları ---------- */
.quick button {
  position: relative;
  overflow: hidden;
}

.quick button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(110, 193, 255, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s var(--ease-soft);
}

.quick button:hover::before {
  opacity: 1;
}

.quick button:hover .q-icon {
  transform: translateY(-2px) scale(1.06);
  color: #ffffff;
}

.q-icon {
  transition: transform 0.35s var(--ease), color 0.3s var(--ease-soft);
}

/* Basıldığında hafif dalga */
.quick button:active::before {
  opacity: 1;
  background: radial-gradient(circle at center, rgba(110, 193, 255, 0.28), transparent 70%);
}

/* ---------- Grafik çubukları ---------- */
.bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
}

.bar-wrap > .bar {
  width: 100%;
  min-height: 0;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transform-origin: bottom;
  animation: huzur-grow 0.9s var(--ease) both;
  transition: filter 0.3s var(--ease-soft), transform 0.3s var(--ease);
}

.bar-wrap:hover > .bar {
  filter: brightness(1.2);
  transform: scaleX(1.06);
}

.bar-wrap > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

@keyframes huzur-grow {
  from { transform: scaleY(0); opacity: 0.4; }
  to   { transform: scaleY(1); opacity: 1; }
}

/* ---------- Liste satırları ---------- */
.request-row {
  transition: background 0.3s var(--ease-soft), transform 0.3s var(--ease), border-color 0.3s var(--ease-soft);
}

.request-row:hover {
  background: rgba(110, 193, 255, 0.06);
  border-color: var(--accent-line);
  transform: translateX(3px);
}

/* ---------- Durum rozetleri ---------- */
.status {
  transition: background 0.3s var(--ease-soft), color 0.3s var(--ease-soft);
}

.status.wait {
  background: rgba(168, 216, 255, 0.12);
  color: var(--yellow);
}

.status.done {
  background: rgba(143, 202, 255, 0.12);
  color: var(--calm);
}

/* ---------- Sayfa geçişi ---------- */
@view-transition {
  navigation: auto;
}

/* Sayfa içi bağlantı hedefleri kaydırmada yumuşak */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

/* ---------- Yükleme iskeleti ---------- */
.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(34, 58, 85, 0.5) 25%, rgba(54, 84, 118, 0.7) 37%, rgba(34, 58, 85, 0.5) 63%);
  background-size: 300% 100%;
  animation: huzur-shimmer 1.4s linear infinite;
}

@keyframes huzur-shimmer {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}

/* ---------- Klavye erişilebilirliği ---------- */
a:focus-visible,
button:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ---------- Hareket azaltma ---------- */
@media (prefers-reduced-motion: reduce) {
  .nav-icon,
  .nav-svg,
  .bar-wrap > .bar,
  .stat::after,
  .q-icon,
  .request-row {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- İkon ölçeği: büyük ve anlaşılır ---------- */
.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.nav-svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.8;
}

.stat-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}

.stat-icon svg {
  width: 18px;
  height: 18px;
}

.quick button .q-icon,
.q-icon {
  width: 30px;
  height: 30px;
}

.q-icon svg {
  width: 26px;
  height: 26px;
}

.empty-icon {
  width: 54px;
  height: 54px;
  font-size: 21px;
}

/* Bekleyen aidat vurgusu mavi */
.stat-foot.warn,
.stat-foot {
  color: var(--accent);
}

/* Uzun sayfada daha rahat okuma */
.nav a {
  min-height: 42px;
  font-size: 13px;
}
/* ---------- Sakin üst çubuğu: mobil menü ve bildirim çanı ---------- */
/* Menü metinleri uzun; mobilde 3 sütunlu ızgara taşmayı önler. */
.topbar .nav{display:flex;flex-wrap:wrap}
.nav a{white-space:nowrap}
@media(max-width:560px){
  .topbar{flex-wrap:wrap;gap:12px;padding:14px 16px}
  .topbar .brand{flex:1 1 auto}
  .topbar .nav{order:3;width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  .nav a,.nav .logout{justify-content:center;padding:9px 6px;font-size:10.5px;gap:5px}
  .nav-ico,.nav .logout svg{width:14px;height:14px}
}
/* Üst çubuk, mutlak konumlanan bildirim çanına zemin oluşturur. */
.topbar{position:relative}
/* Çan sağ üst köşede; marka alanı çanla çakışmasın. */
.topbar .brand{margin-right:96px}
@media(max-width:560px){
  .topbar{padding-right:16px}
  .topbar .brand{margin-right:60px}
  .komsu-notify-top{top:14px;right:14px}
}
