/* nefis.celalcan.net — minimal çetele arayüzü */

:root {
  --bg: #ffffff;
  --fg: #1c1c1e;
  --muted: #8a8a8e;
  --line: #ededf0;
  --card: #fafafb;
  --accent: #1c1c1e;
  --radius: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: conic-gradient(#e8807b, #e28fc9, #7c6fd1, #5a8fe0, #5cb37f, #c9cf2a, #d98b4a, #e8807b);
}
.brand-muted { color: var(--muted); font-weight: 400; }
.top-actions { display: flex; gap: 8px; }

/* ---------- Layout ---------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 40px 28px 80px; }
.wrap-wide { max-width: 1240px; }
.hero { margin-bottom: 28px; }
.hero h1 { font-size: 28px; margin-bottom: 4px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--fg);
  font: inherit; font-weight: 500; font-size: 14px;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
}
.btn:hover { background: #f4f4f6; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #333; }
.btn-ghost { background: transparent; border-style: dashed; }
.btn-danger-ghost { color: #d24c4c; }
.btn-danger-ghost:hover { background: #fdeeee; border-color: #f5cccc; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn {
  appearance: none; border: 0; background: transparent; font-size: 24px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.icon-btn:hover { background: #f4f4f6; color: var(--fg); }

/* ---------- Dashboard cards ---------- */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  display: block; padding: 20px 22px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.06); border-color: #e2e2e6; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card h3 { font-size: 18px; margin-bottom: 2px; }
.meta { font-size: 13px; }
.badge {
  font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px;
  background: #f0f0f3; color: var(--fg);
}
.badge-active { background: #e6f5ec; color: #2c8a52; }
.badge-upcoming { background: #eef1fb; color: #4d6fd1; }
.badge-finished { background: #f0f0f3; color: var(--muted); }
.pct { font-weight: 600; font-size: 14px; }
.dots { display: flex; gap: 6px; margin: 14px 0 12px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: block; }
.bar { height: 5px; border-radius: 99px; background: #f0f0f3; overflow: hidden; }
.bar span {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #e8807b, #e28fc9, #7c6fd1, #5a8fe0, #5cb37f, #c9cf2a);
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h2 { font-size: 20px; margin-bottom: 6px; }
.empty p { margin: 0 0 20px; }
.empty-rings { display: flex; justify-content: center; gap: 8px; margin-bottom: 22px; }
.empty-rings span {
  width: 26px; height: 26px; border-radius: 50%; background: var(--c);
  animation: bob 2.4s ease-in-out infinite; opacity: .9;
}
.empty-rings span:nth-child(2) { animation-delay: .15s; }
.empty-rings span:nth-child(3) { animation-delay: .3s; }
.empty-rings span:nth-child(4) { animation-delay: .45s; }
.empty-rings span:nth-child(5) { animation-delay: .6s; }
.empty-rings span:nth-child(6) { animation-delay: .75s; }
.empty-rings span:nth-child(7) { animation-delay: .9s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Sheet (çetele) ---------- */
.sheet-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  flex-wrap: wrap; margin-bottom: 36px;
}
.sheet-title { font-size: 30px; font-weight: 300; letter-spacing: -0.02em; color: #4a4a4e; }
.sheet-title b { font-weight: 700; color: var(--fg); }
.sheet-title .slash { margin: 0 6px; color: var(--muted); font-weight: 300; }
.sheet-stats { display: flex; gap: 28px; }
.stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.stat .muted { font-size: 12px; }
.stat-num { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.stat-num small { font-size: 15px; color: var(--muted); font-weight: 500; }

.notice {
  padding: 12px 16px; border-radius: 12px; background: #f7f7f9; color: #55555a;
  font-size: 14px; margin-bottom: 24px;
}

.sheet { display: flex; flex-direction: column; gap: 14px; }

.row {
  display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: start;
}
.label {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--c) 14%, #fff);
  color: color-mix(in srgb, var(--c) 78%, #000);
  position: sticky; left: 0;
}
.label-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.label-count { font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }

.days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}
@media (min-width: 1100px) {
  .days { grid-template-columns: repeat(21, 1fr); } /* 41 gün → 21 + 20 */
}

/* ---------- Day circle ---------- */
.day {
  --tint: calc(10% + var(--i) * 1.4%);            /* 1. gün %10 → 41. gün ~%66 (görseldeki gradyan) */
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: grid; place-items: center;
  font: inherit; font-weight: 600; font-size: 15px;
  cursor: default;
  background: color-mix(in srgb, var(--c) var(--tint), #fff);
  color: color-mix(in srgb, var(--c) 90%, #000);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), background .25s, color .25s, box-shadow .25s;
  -webkit-tap-highlight-color: transparent;
}
.day .num { position: relative; z-index: 1; transition: opacity .15s, transform .2s; }
.day .check {
  position: absolute; inset: 0; margin: auto; width: 55%; height: 55%;
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 24; stroke-dashoffset: 24;
  opacity: 0; z-index: 2;
}

/* Bugün */
.day.is-today {
  cursor: pointer;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--c) 60%, #fff);
  animation: pulse 2.2s ease-in-out infinite;
}
.day.is-today:hover { transform: scale(1.08); }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--c) 60%, #fff); }
  50%     { box-shadow: 0 0 0 2px #fff, 0 0 0 7px color-mix(in srgb, var(--c) 22%, #fff); }
}
.day.is-today.is-marked { animation: none; }

/* Geçmiş, işaretlenmemiş → soluk + kaçırıldı */
.day.is-past:not(.is-marked) { opacity: .45; }
.day.is-past:not(.is-marked) .num { text-decoration: line-through; text-decoration-thickness: 1.5px; }

/* İşaretli */
.day.is-marked {
  background: var(--c);
  color: #fff;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 30%, transparent);
}
.day.is-marked .num { opacity: 0; transform: scale(.6); }
.day.is-marked .check { opacity: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .35s ease .1s, opacity .1s; }

/* İşaretleme animasyonu */
.day.pop { animation: pop .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop {
  0%   { transform: scale(.7); }
  60%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.day .ripple {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--c); opacity: .8;
  animation: ripple .7s ease-out forwards; pointer-events: none;
}
@keyframes ripple {
  from { transform: scale(1); opacity: .8; }
  to   { transform: scale(2.1); opacity: 0; }
}
.day .spark {
  position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; border-radius: 50%;
  background: var(--c); pointer-events: none;
  animation: spark .6s ease-out forwards;
}
@keyframes spark {
  from { transform: translate(-50%,-50%) rotate(var(--a)) translateY(0); opacity: 1; }
  to   { transform: translate(-50%,-50%) rotate(var(--a)) translateY(-30px) scale(.3); opacity: 0; }
}
.day.shake { animation: shake .35s; }
@keyframes shake {
  0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); }
}

.foot { font-size: 12.5px; text-align: center; max-width: 760px; margin: 56px auto 0; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 20px;
  background: rgba(20,20,22,.35); backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: 100%; max-width: 520px; max-height: 92vh; overflow: auto;
  background: #fff; border-radius: 20px; padding: 24px 26px 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.18);
  animation: rise .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h2 { font-size: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 500; color: #55555a; }
.field small { font-size: 12px; }
input[type=text], input[type=date] {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fafafb; outline: none; transition: border-color .15s, background .15s;
}
input[type=text]:focus, input[type=date]:focus { border-color: #b9b9c2; background: #fff; }

.habit-list { display: flex; flex-direction: column; gap: 8px; }
.habit-row { display: flex; align-items: center; gap: 8px; }
.habit-row input[type=text] { flex: 1; min-width: 0; }
.habit-row .swatch {
  width: 36px; height: 36px; border-radius: 50%; flex: none; cursor: pointer;
  border: 0; padding: 0; background: var(--c); position: relative;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.7), 0 0 0 1px var(--line);
}
.habit-row .swatch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.habit-row .rm {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font-size: 18px; cursor: pointer; padding: 6px; border-radius: 8px; line-height: 1;
}
.habit-row .rm:hover { color: #d24c4c; background: #fdeeee; }
.habit-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.form-error { color: #d24c4c; font-size: 13px; margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1c1c1e; color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.2);
  animation: rise .25s cubic-bezier(.2,.8,.2,1);
}
.toast[hidden] { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .top { padding: 14px 18px; }
  .wrap { padding: 28px 16px 60px; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .label { flex-direction: row; align-items: center; justify-content: space-between; padding: 8px 12px; }
  .days { grid-template-columns: repeat(7, 1fr); gap: 5px; } /* 41 gün → 5×7 + 6 */
  .day { font-size: 13px; }
  .sheet-title { font-size: 22px; }
  .sheet-stats { width: 100%; justify-content: flex-start; }
  .stat { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
