:root {
  --bg: #12141a;
  --surface: #1b1e27;
  --surface-2: #232838;
  --border: #2b3040;
  --text: #eef1f6;
  --text-dim: #9aa3b8;
  --text-faint: #6b7288;

  --color-work: #ef6461;
  --color-short-break: #4a9d8f;
  --color-long-break: #6c8ff0;

  --accent: var(--color-work);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --bg-gradient-start: #1a1f2e;
  --card-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"] {
  --bg: #f2f3f7;
  --surface: #ffffff;
  --surface-2: #edeff5;
  --border: #dde1ea;
  --text: #1c1f2a;
  --text-dim: #545b70;
  --text-faint: #8890a4;
  --bg-gradient-start: #ffffff;
  --card-shadow: 0 12px 28px -18px rgba(30, 34, 48, 0.16);
}

/* Nord: https://www.nordtheme.com */
:root[data-theme="nord"] {
  --bg: #2e3440;
  --surface: #3b4252;
  --surface-2: #434c5e;
  --border: #4c566a;
  --text: #eceff4;
  --text-dim: #d8dee9;
  --text-faint: #81a1c1;
  --bg-gradient-start: #3b4252;
  --card-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.55);
  --color-work: #bf616a;
  --color-short-break: #a3be8c;
  --color-long-break: #88c0d0;
}

/* Dracula: https://draculatheme.com */
:root[data-theme="dracula"] {
  --bg: #191a21;
  --surface: #282a36;
  --surface-2: #343746;
  --border: #44475a;
  --text: #f8f8f2;
  --text-dim: #a0a8c9;
  --text-faint: #6272a4;
  --bg-gradient-start: #282a36;
  --card-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.6);
  --color-work: #ff5555;
  --color-short-break: #50fa7b;
  --color-long-break: #8be9fd;
}

/* Catppuccin Mocha: https://catppuccin.com */
:root[data-theme="catppuccin"] {
  --bg: #11111b;
  --surface: #1e1e2e;
  --surface-2: #313244;
  --border: #585b70;
  --text: #cdd6f4;
  --text-dim: #a6adc8;
  --text-faint: #6c7086;
  --bg-gradient-start: #181825;
  --card-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.6);
  --color-work: #f38ba8;
  --color-short-break: #a6e3a1;
  --color-long-break: #89b4fa;
}

/* Gruvbox Dark: https://github.com/morhetz/gruvbox */
:root[data-theme="gruvbox"] {
  --bg: #282828;
  --surface: #3c3836;
  --surface-2: #504945;
  --border: #665c54;
  --text: #ebdbb2;
  --text-dim: #a89984;
  --text-faint: #928374;
  --bg-gradient-start: #3c3836;
  --card-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.55);
  --color-work: #fb4934;
  --color-short-break: #b8bb26;
  --color-long-break: #83a598;
}

/* Solarized Light: https://ethanschoonover.com/solarized */
:root[data-theme="solarized-light"] {
  --bg: #eee8d5;
  --surface: #fdf6e3;
  --surface-2: #eee8d5;
  --border: #93a1a1;
  --text: #586e75;
  --text-dim: #657b83;
  --text-faint: #93a1a1;
  --bg-gradient-start: #fdf6e3;
  --card-shadow: 0 12px 28px -18px rgba(88, 110, 117, 0.18);
  --color-work: #dc322f;
  --color-short-break: #859900;
  --color-long-break: #268bd2;
}

* {
  box-sizing: border-box;
}

/* Sayı girdilerindeki yerleşik yukarı/aşağı okları tarayıcı hiçbir zaman
   temaya uydurmuyor (her zaman beyaz/native kalır) - tüm uygulamada tutarlı
   görünsün diye kaldırılıp klavye ok tuşlarıyla artırma/azaltma korunuyor. */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% -10%, var(--bg-gradient-start) 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

.app-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* .auth-screen { display: flex } yukarıda, [hidden]'in display:none'unu
   author-stylesheet specificity'siyle ezmesin diye açıkça geri veriyoruz
   (bkz. .blackout-overlay[hidden] ile aynı sorun). */
.auth-screen[hidden] {
  display: none;
}

.auth-card {
  width: min(360px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--card-shadow);
}

.auth-title {
  margin: 0 0 1.5rem;
  text-align: center;
  font-size: 1.4rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* .auth-form { display: flex } yukarıda, [hidden]'in display:none'unu
   author-stylesheet specificity'siyle ezmesin diye açıkça geri veriyoruz
   (bkz. .blackout-overlay[hidden] ile aynı sorun). */
.auth-form[hidden] {
  display: none;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.auth-form input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--accent);
}

.auth-hint {
  margin: -0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.auth-about-link {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-faint);
  text-decoration: none;
}

.auth-about-link:hover {
  color: var(--accent);
}

.auth-error {
  color: var(--color-work);
  font-size: 0.85rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0.9rem;
  font-size: 0.75rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

#continue-guest-btn {
  width: 100%;
}

.current-username {
  font-size: 0.85rem;
  color: var(--text-dim);
  align-self: center;
}

.app-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text-dim);
}

/* ---- Marka: "MUVAHHİD" vurgulu/büyük harf, "Pomodoro" normal devam ---- */

.brand-caps {
  font-size: 1.05em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand-rest {
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}

.app-lang-select {
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 40px;
  padding: 0 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.app-lang-select:hover {
  color: var(--text);
  border-color: var(--accent);
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: rotate(20deg);
}

.icon-btn-small {
  width: 28px;
  height: 28px;
}

#theme-toggle {
  position: relative;
  overflow: hidden;
}

#theme-toggle svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

#theme-toggle svg[hidden] {
  display: block;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg) scale(0.5);
  pointer-events: none;
}

main {
  display: grid;
  grid-template-columns: minmax(300px, 440px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.column-primary,
.column-secondary {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .stat-cards {
    grid-template-columns: 1fr;
  }
}

/* ---- Timer card ---- */

.timer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--card-shadow);
}

#timer-section[data-phase="work"] { --accent: var(--color-work); }
#timer-section[data-phase="short_break"] { --accent: var(--color-short-break); }
#timer-section[data-phase="long_break"] { --accent: var(--color-long-break); }

.phase-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  transition: color 0.3s ease;
}

.ring-wrap {
  position: relative;
  width: min(240px, 60vw);
  height: min(240px, 60vw);
}

.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
  transition: filter 0.3s ease;
}

.ring-bg,
.ring-progress {
  fill: none;
  stroke-width: 10;
}

.ring-bg {
  stroke: var(--surface-2);
}

.ring-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.25s linear, stroke 0.3s ease;
}

.time-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2.4rem, 9vw, 3.2rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.task-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.task-input:focus {
  border-color: var(--accent);
}

.task-input:disabled {
  color: var(--text-dim);
  opacity: 0.85;
}

.task-input.input-error {
  border-color: var(--color-work);
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.controls {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.btn {
  flex: 1;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #14161c;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.5);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

.cycle-indicator {
  display: flex;
  gap: 0.4rem;
}

.cycle-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cycle-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}

/* ---- Tasks panel ---- */

.tasks-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

.task-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.task-form-input {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
  outline: none;
}

.task-form-input:focus {
  border-color: var(--accent);
}

.task-form-estimate {
  width: 3.2rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.4rem;
  font-size: 0.88rem;
  outline: none;
  text-align: center;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-item:hover {
  background: var(--surface-2);
}

.task-item.task-active {
  border-color: var(--accent);
  background: var(--surface-2);
}

.task-checkbox {
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.task-text {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-item.task-done .task-text {
  color: var(--text-faint);
  text-decoration: line-through;
}

.task-progress {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.task-delete {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.task-item:hover .task-delete,
.task-delete:focus-visible {
  opacity: 1;
}

.task-edit {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.task-item:hover .task-edit,
.task-edit:focus-visible {
  opacity: 1;
}

.task-edit:hover {
  color: var(--accent);
  background: var(--surface);
}

.task-rename-input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem;
  font-size: 0.88rem;
  outline: none;
}

.task-delete:hover {
  color: var(--color-work);
  background: var(--surface);
}

.task-empty {
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.plan-estimate {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

/* ---- Clock styles ---- */

.linear-progress {
  display: none;
  width: 100%;
  max-width: 220px;
  height: 6px;
  margin-top: 0.75rem;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.linear-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s linear, background 0.3s ease;
}

#timer-section[data-clock-style="digital"] .ring,
#timer-section[data-clock-style="minimal"] .ring {
  display: none;
}

#timer-section[data-clock-style="digital"] .ring-wrap,
#timer-section[data-clock-style="minimal"] .ring-wrap {
  position: static;
  width: auto;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#timer-section[data-clock-style="digital"] .time-display,
#timer-section[data-clock-style="minimal"] .time-display {
  position: static;
}

#timer-section[data-clock-style="digital"] .time-display {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  font-family: "Courier New", monospace;
  letter-spacing: 0.06em;
  color: var(--accent);
  transition: color 0.3s ease, border-color 0.15s ease, text-shadow 0.3s ease;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.28), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

#timer-section[data-clock-style="minimal"] .time-display {
  font-size: clamp(3.2rem, 13vw, 5rem);
  font-weight: 800;
  color: var(--accent);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

#timer-section[data-clock-style="digital"] .linear-progress,
#timer-section[data-clock-style="minimal"] .linear-progress {
  display: block;
}

/* ---- Özel arka plan ---- */

body.has-custom-bg {
  background: none;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-youtube-container {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #000;
}

.bg-youtube-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;
  min-height: 100vh;
  min-width: 177.78vh;
  transform: translate(-50%, -50%);
  border: 0;
}

/* ---- Settings panel ---- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 14, 0.55);
  z-index: 40;
}

:root[data-theme="light"] .modal-backdrop {
  background: rgba(30, 34, 48, 0.35);
}

/* ---- Mola karartması ---- */

.blackout-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
}

/* .blackout-overlay { display: flex } yukarıda, [hidden]'in display:none'unu
   author-stylesheet specificity'siyle ezmesin diye açıkça geri veriyoruz. */
.blackout-overlay[hidden] {
  display: none;
}

.blackout-phase {
  color: rgba(255, 255, 255, 0.55);
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blackout-time {
  font-size: clamp(3.5rem, 14vw, 8rem);
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  line-height: 1;
}

.blackout-hint {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 2rem));
  max-height: 85vh;
  overflow-y: auto;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

@keyframes panel-enter {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.settings-panel:not([hidden]) {
  animation: panel-enter 0.18s ease;
}

.settings-panel .panel-header {
  margin-bottom: 1.25rem;
}

.settings-panel h2,
.stats-panel h2,
.history-panel h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.settings-grid input[type="number"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  outline: none;
}

.settings-grid input[type="number"]:focus {
  border-color: var(--color-work);
}

.settings-grid select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  outline: none;
}

.settings-grid select:focus {
  border-color: var(--color-work);
}

.checkbox-row {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.settings-error {
  margin-top: 0.9rem;
  color: var(--color-work);
  font-size: 0.85rem;
}

.settings-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
}

.settings-actions .btn {
  flex: 1;
}

/* ---- Görünüm paneli ---- */

.appearance-subheading {
  margin: 1.5rem 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.appearance-panel .settings-grid + .appearance-subheading {
  border-top: none;
  padding-top: 0;
}

.color-picker-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.color-picker-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.appearance-panel select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  outline: none;
  width: 100%;
}

.appearance-panel select:focus {
  border-color: var(--accent);
}

.appearance-panel input[type="color"] {
  width: 100%;
  min-width: 64px;
  height: 40px;
  padding: 0.2rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.appearance-panel label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.appearance-panel input[type="url"],
.appearance-panel input[type="text"],
.appearance-panel input[type="file"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  outline: none;
}

.appearance-panel input[type="file"]::file-selector-button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  margin-right: 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.appearance-panel input[type="file"]::file-selector-button:hover {
  border-color: var(--accent);
}

.appearance-subfield {
  margin-bottom: 0.75rem;
}

.appearance-opacity-field {
  min-width: 160px;
  flex: 1;
}

.appearance-opacity-field input[type="range"] {
  width: 100%;
  accent-color: var(--color-work);
}

.appearance-opacity-value {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.appearance-hint {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.appearance-panel .btn-small {
  margin-top: 0.25rem;
}

.panel-visibility-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.panel-visibility-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, opacity 0.15s ease;
}

.panel-visibility-item:hover {
  background: var(--surface-2);
}

.panel-visibility-item.dragging {
  opacity: 0.4;
}

.panel-visibility-item .checkbox-row {
  display: flex;
  margin: 0;
  cursor: pointer;
}

/* ---- Planner panel ---- */

.planner-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

.planner-panel h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
}

.planner-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.planner-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.planner-form input,
.planner-form select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  outline: none;
}

.planner-form input:focus,
.planner-form select:focus {
  border-color: var(--accent);
}

.planner-summary {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
}

.planner-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.planner-timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.planner-timeline-item.is-work {
  background: var(--surface-2);
}

.planner-timeline-item.is-break {
  color: var(--text-faint);
}

.planner-empty {
  color: var(--text-faint);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
  margin: 0;
}

/* ---- Verse panel ---- */

.verse-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

.verse-panel h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
}

.verse-panel .panel-header {
  margin-bottom: 1rem;
}

.verse-translation {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 0.75rem;
}

.verse-translation[dir="rtl"] {
  text-align: right;
}

.verse-reference {
  display: block;
  color: var(--text-faint);
  font-size: 0.75rem;
  text-align: right;
  margin: 0;
  text-decoration: none;
  transition: color 0.15s ease;
}

.verse-reference:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---- Stats panel ---- */

.stats-panel,
.history-panel,
.mini-stats-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

.mini-stats-panel h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
}

.mini-active-task {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 1rem;
  min-height: 1.3em;
}

.mini-active-task.mini-active-task-empty {
  color: var(--text-faint);
  font-size: 0.85rem;
}

.report-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.report-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.report-tab:hover {
  color: var(--text);
}

.report-tab.active {
  background: var(--accent);
  color: #14161c;
  border-color: var(--accent);
}

/* ---- Ayet: rastgele/hatim modu + kaydedilen ayetler ---- */

.verse-mode-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.verse-mode-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.verse-mode-tab:hover {
  color: var(--text);
}

.verse-mode-tab.active {
  background: var(--accent);
  color: #14161c;
  border-color: var(--accent);
}

.saved-verses-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.saved-verse-item {
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}

.saved-verse-text {
  margin: 0 0 0.5rem;
  color: var(--text);
  line-height: 1.55;
  font-size: 0.9rem;
}

.saved-verse-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.saved-verse-reference {
  font-size: 0.75rem;
  color: var(--text-faint);
  text-decoration: none;
}

.saved-verse-reference:hover {
  color: var(--accent);
}

.saved-verse-delete {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.saved-verse-delete:hover {
  color: var(--color-work);
  background: var(--surface);
}

.saved-verse-empty {
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 1rem 0.5rem;
  text-align: center;
}

.notes-hint {
  margin: 0 0 0.75rem;
  color: var(--text-faint);
  font-size: 0.8rem;
}

.note-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.note-form-input {
  resize: vertical;
  min-height: 4.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
}

.note-form-input:focus {
  border-color: var(--accent);
}

.notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.note-item {
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}

.note-text {
  margin: 0 0 0.5rem;
  color: var(--text);
  line-height: 1.55;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.note-days-left {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.note-delete {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.note-delete:hover {
  color: var(--color-work);
  background: var(--surface);
}

.notes-empty {
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 1rem 0.5rem;
  text-align: center;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color 0.15s ease;
}

.stat-card:hover {
  border-color: var(--accent);
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.stat-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  height: 120px;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 0.35rem;
}

.chart-track {
  width: 100%;
  max-width: 22px;
  height: 86px;
  display: flex;
  align-items: flex-end;
}

.chart-fill {
  width: 100%;
  background: var(--color-work);
  border-radius: 4px 4px 0 0;
  opacity: 0.85;
  transition: height 0.3s ease;
}

.chart-label {
  font-size: 0.65rem;
  color: var(--text-faint);
}

.goal-progress {
  margin-top: 1.1rem;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.goal-bar {
  height: 100%;
  width: 0%;
  background: var(--color-work);
  border-radius: 999px;
  transition: width 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.goal-bar.goal-complete {
  background: var(--color-short-break);
}

.goal-text {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-faint);
  text-align: right;
}

/* ---- History ---- */

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel-header-actions {
  display: flex;
  gap: 0.5rem;
}

.panel-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.drag-handle {
  cursor: grab;
  color: var(--text-faint);
  font-size: 1.1rem;
  line-height: 1;
  user-select: none;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.column-secondary section.dragging {
  opacity: 0.4;
}

.history-panel .panel-header h2 {
  margin: 0;
}

.btn-small {
  flex: none;
  padding: 0.45rem 0.8rem;
  font-size: 0.78rem;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.history-item:hover {
  background: var(--surface-2);
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.history-work .history-dot { background: var(--color-work); }
.history-short_break .history-dot { background: var(--color-short-break); }
.history-long_break .history-dot { background: var(--color-long-break); }

.history-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 0.15rem;
}

.history-title {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.history-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
  white-space: nowrap;
}

.history-delete {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.history-item:hover .history-delete,
.history-delete:focus-visible {
  opacity: 1;
}

.history-delete:hover {
  color: var(--color-work);
  background: var(--surface);
}

.history-empty {
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 1rem 0.5rem;
  text-align: center;
}

.history-date-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 0.5rem 0.5rem 0.15rem;
  margin-top: 0.25rem;
}

.history-date-header:first-child {
  margin-top: 0;
  padding-top: 0;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

/* ---- Leaderboard ---- */

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.leaderboard-row:hover {
  background: var(--surface-2);
}

.leaderboard-row.is-you {
  background: var(--surface-2);
  border: 1px solid var(--accent);
}

.leaderboard-rank {
  width: 2rem;
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-faint);
}

.leaderboard-row:nth-child(1) .leaderboard-rank { color: #e0b13a; }
.leaderboard-row:nth-child(2) .leaderboard-rank { color: #b8bfca; }
.leaderboard-row:nth-child(3) .leaderboard-rank { color: #c98a4b; }

.leaderboard-name {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-count {
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-shrink: 0;
  white-space: nowrap;
}

.leaderboard-empty {
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 1rem 0.5rem;
  text-align: center;
}

/* ---- Side menu (sağdan açılan panel) ---- */

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(320px, 88vw);
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.22s ease, visibility 0s linear 0.22s;
}

.side-menu.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.22s ease, visibility 0s linear 0s;
}

.side-menu .panel-header {
  margin-bottom: 0;
}

.side-menu-account {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.side-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.side-menu-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.7rem 0.6rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.side-menu-item:hover {
  background: var(--surface-2);
}

.side-menu-item svg {
  flex-shrink: 0;
  color: var(--text-dim);
}

.side-menu-bmc {
  display: block;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.side-menu-bmc img {
  max-width: 100%;
  height: auto;
}

/* ---- Hakkımızda paneli ---- */

.about-panel-section {
  margin-bottom: 1.25rem;
}

.about-panel-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.about-panel-section p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 0.9rem;
}

.guide-section-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.guide-section-heading h3 {
  margin: 0;
}

.guide-section-icon {
  flex-shrink: 0;
  color: var(--accent);
}

.about-panel-support {
  text-align: center;
}

.about-panel-support img {
  max-width: 100%;
  height: auto;
  margin-top: 0.5rem;
}

/* ---- İletişim formu (Hakkımızda paneli + standalone about.html) ---- */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.contact-form input,
.contact-form textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.contact-error {
  color: var(--color-work);
  font-size: 0.85rem;
}

.contact-success {
  color: var(--color-short-break);
  font-size: 0.85rem;
}

/* ---- Focus mode ---- */

body.is-fullscreen .column-secondary {
  display: none;
}

body.is-fullscreen main {
  grid-template-columns: 1fr;
  justify-items: center;
}

body.is-fullscreen .column-primary {
  width: 100%;
  max-width: 480px;
}

body.is-fullscreen .timer-card {
  min-height: 82vh;
  justify-content: center;
}

body.is-fullscreen .ring-wrap {
  width: min(380px, 60vh);
  height: min(380px, 60vh);
}

body.is-fullscreen .time-display {
  font-size: clamp(3rem, 9vw, 4.6rem);
}

body.is-fullscreen #timer-section[data-clock-style="minimal"] .time-display {
  font-size: clamp(5rem, 18vw, 9rem);
}

body.is-fullscreen #timer-section[data-clock-style="digital"] .time-display {
  font-size: clamp(3.4rem, 11vw, 6rem);
  padding: 2rem 3rem;
}

body.is-fullscreen .linear-progress {
  max-width: 320px;
  height: 8px;
}

/* ---- Mini görünüm ---- */

body.is-mini #tasks-panel {
  display: none;
}

body.is-mini .column-secondary > section:not(#mini-stats-panel) {
  display: none;
}

body.is-mini #mini-stats-panel {
  display: block;
}

body.is-mini main {
  align-items: stretch;
}

body.is-mini .timer-card {
  height: 100%;
}

/* ---- Neon efekt modu (isteğe bağlı görünüm) ---- */

body[data-fx="neon"] .ring {
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent) 40%, transparent));
}

body[data-fx="neon"] .btn-primary {
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 65%, transparent);
}

body[data-fx="neon"] .btn-primary:hover {
  box-shadow: 0 8px 22px -6px color-mix(in srgb, var(--accent) 75%, transparent);
}

body[data-fx="neon"] .cycle-dot.filled {
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent);
}

body[data-fx="neon"] #timer-section[data-clock-style="digital"] .time-display {
  text-shadow: 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent);
}

body[data-fx="neon"] #timer-section[data-clock-style="minimal"] .time-display {
  text-shadow: 0 0 32px color-mix(in srgb, var(--accent) 40%, transparent);
}

body[data-fx="neon"] .goal-bar {
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-work) 55%, transparent);
}

body[data-fx="neon"] .goal-bar.goal-complete {
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-short-break) 55%, transparent);
}
