/* ===== Renkler ve temel ayarlar ===== */
:root {
  --cream: #fdf8ee; --green: #d9efdd; --green-d: #7fbf94;
  --lav: #e8e2f8; --lav-d: #a995e8; --pink: #fce2ea; --pink-d: #ee9db6;
  --ink: #3b3850; --muted: #67647c; --card: #fffdf8;
  --radius: 22px; --shadow: 0 6px 20px rgba(120, 100, 160, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif; line-height: 1.5;
}
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; }
h2 { font-size: 1.4rem; } h3 { font-size: 1.05rem; margin-top: 1.4rem; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lav-d); outline-offset: 2px; }

/* ===== Üst menü ===== */
.site-header {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .5rem 1rem; padding: .7rem 1.2rem;
  background: rgba(253, 248, 238, .92); backdrop-filter: blur(6px); border-bottom: 2px solid var(--lav);
}
.brand { font-weight: 800; font-size: 1.2rem; text-decoration: none; }
.nav-links { display: flex; flex-wrap: wrap; gap: .3rem; }
.nav-links a { padding: .35rem .8rem; border-radius: 999px; text-decoration: none; transition: background .2s; }
.nav-links a:hover { background: var(--green); }
.mode-switch { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 700; }
.mode-switch input { position: absolute; opacity: 0; }
.track { width: 44px; height: 24px; border-radius: 999px; background: var(--lav); position: relative; transition: background .2s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.mode-switch input:checked + .track { background: var(--green-d); }
.mode-switch input:checked + .track::after { transform: translateX(20px); }
.mode-switch input:focus-visible + .track { outline: 3px solid var(--lav-d); outline-offset: 2px; }

/* ===== Düzen ve kartlar ===== */
main { max-width: 900px; margin: 0 auto; padding: 1.2rem; display: grid; gap: 1.4rem; }
.card { background: var(--card); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.center { text-align: center; }
.sub { color: var(--muted); margin: .2rem 0; }
.empty { color: var(--muted); background: var(--cream); border-radius: 14px; padding: .8rem 1rem; text-align: center; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(135deg, var(--green), var(--lav) 60%, var(--pink)); }
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.date { margin: 0 0 .3rem; font-weight: 700; color: var(--muted); }

/* ===== Butonlar ve form alanları ===== */
.btn, .tab {
  font: inherit; font-weight: 700; color: var(--ink); background: var(--lav); border: 0;
  border-radius: 999px; padding: .6rem 1.2rem; cursor: pointer; transition: transform .15s, background .2s;
}
.btn:hover, .tab:hover { transform: translateY(-2px); background: #dcd3f5; }
.btn.primary { background: var(--green-d); }
.btn.primary:hover { background: #6fb386; }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1rem; }
.tab { background: var(--cream); border: 2px solid var(--lav); }
.tab.active { background: var(--pink); border-color: var(--pink-d); }
input[type="number"], input[type="text"] {
  font: inherit; color: var(--ink); padding: .5rem .8rem; border: 2px solid var(--lav); border-radius: 12px; background: #fff; width: 100%;
}
label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; }

/* ===== Dairesel göstergeler ===== */
.ring { position: relative; width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto 1rem; }
.ring.small { width: min(100%, 200px); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg, .ring-fill { fill: none; stroke-width: 12; }
.ring-bg { stroke: var(--lav); }
.ring-fill { stroke-linecap: round; transition: stroke-dashoffset .4s; }
.timer-fill { stroke: var(--pink-d); } .perf-fill { stroke: var(--green-d); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-text strong { font-size: clamp(2.4rem, 12vw, 3.4rem); font-variant-numeric: tabular-nums; }
.ring-text span { color: var(--muted); }
.controls { display: flex; justify-content: center; gap: .8rem; }
#pomodoro { text-align: center; }
.timer-settings { margin-top: 1.2rem; text-align: left; }
.timer-settings summary { cursor: pointer; font-weight: 700; }
.timer-settings form { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; align-items: end; margin-top: .8rem; }
.msg { font-weight: 800; font-size: 1.1rem; }

/* ===== İstatistikler ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }
.stat { border-radius: 18px; padding: 1rem; display: grid; gap: .2rem; }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat strong { font-size: 1.3rem; }
.stat.green { background: var(--green); } .stat.lav { background: var(--lav); }
.stat.pink { background: var(--pink); } .stat.cream { background: #f6efdc; }
.forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.forms form { background: var(--cream); border-radius: 18px; padding: 1rem; display: grid; gap: .7rem; }
.forms h3 { margin: 0; }
.chart { display: flex; align-items: flex-end; justify-content: space-between; gap: .4rem; height: 180px; padding-top: 1rem; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .25rem; min-width: 0; }
.bar-val { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.bar { width: 100%; max-width: 48px; min-height: 4px; background: var(--lav-d); border-radius: 10px 10px 4px 4px; transition: height .4s; }
.bar-col.today .bar { background: var(--green-d); }
.bar-label { font-size: .8rem; font-weight: 700; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.history li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; background: var(--cream); border-radius: 14px; padding: .6rem .9rem; }
.history .grow, .tasks .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.badge { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .1rem .6rem; background: var(--green); }
.badge.manual { background: var(--pink); }
.mini { font: inherit; border: 0; background: var(--lav); border-radius: 10px; padding: .25rem .6rem; cursor: pointer; }
.mini:hover { background: #dcd3f5; }

/* ===== Görevler ===== */
.task-form { display: flex; gap: .6rem; }
.tasks { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .5rem; }
.tasks li { display: flex; align-items: center; gap: .7rem; background: var(--cream); border-radius: 14px; padding: .6rem .9rem; }
.tasks input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--green-d); cursor: pointer; flex: none; }
.task-form select { font: inherit; color: var(--ink); padding: .5rem .8rem; border: 2px solid var(--lav); border-radius: 12px; background: #fff; cursor: pointer; }
.prio { flex: none; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .1rem .7rem; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(59, 56, 80, .15); }
.prio.low { background: var(--green); }
.prio.medium { background: #fbeec2; }
.prio.high { background: var(--pink-d); }
.tasks li.done .grow { text-decoration: line-through; color: var(--muted); }
.tasks li.done { background: var(--green); }

/* ===== Hesap makinesi ===== */
.calc-card { max-width: 340px; width: 100%; justify-self: center; }
.calc-display { background: var(--lav); border-radius: 16px; padding: .8rem 1rem; text-align: right; font-size: 1.8rem; font-weight: 800; overflow-x: auto; white-space: nowrap; }
.calc-msg { min-height: 1.4rem; margin: .3rem 0; color: #a3405f; font-size: .9rem; font-weight: 700; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.k { font: inherit; font-size: 1.15rem; font-weight: 700; color: var(--ink); background: var(--cream); border: 2px solid var(--lav); border-radius: 14px; padding: .7rem 0; cursor: pointer; transition: background .15s; }
.k:hover { background: var(--green); }
.k.op { background: var(--lav); } .k.fn { background: var(--pink); } .k.eq { background: var(--green-d); grid-row: span 2; }
.k.wide { grid-column: span 2; }

/* ===== Alt bilgi ve bildirimler ===== */
.site-footer { text-align: center; color: var(--muted); padding: 1.5rem 1rem 2.5rem; }
.toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 20; width: min(92vw, 380px); }
.toast { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 14px; box-shadow: var(--shadow); text-align: center; animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* ===== Focus Mode: dikkat dağıtan her şeyi gizle ===== */
body.focus .nav-links, body.focus main > section:not(#pomodoro),
body.focus .site-footer, body.focus .timer-settings { display: none; }
body.focus main { min-height: 80vh; align-content: center; }
body.focus #pomodoro { box-shadow: none; background: transparent; }
body.focus .ring { width: min(90vw, 440px); }

@media (max-width: 560px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .card { padding: 1.1rem; }
  .task-form { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }