/* ===========================================================
   Pomo25 — Pomodoro Timer styles
   =========================================================== */
:root {
  --bg: #ba4949;            /* pomodoro */
  --bg-dark: #a23f3f;
  --card: rgba(255, 255, 255, 0.12);
  --card-solid: rgba(255, 255, 255, 0.95);
  --text: #ffffff;
  --text-dark: #1c1c1c;
  --accent: #ffffff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  --maxw: 620px;
  --font: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --transition: background-color 600ms ease;
}

/* per-mode background colors */
body[data-mode="pomodoro"]  { --bg: #ba4949; --bg-dark: #a23f3f; }
body[data-mode="shortBreak"] { --bg: #38858a; --bg-dark: #2f7176; }
body[data-mode="longBreak"]  { --bg: #397097; --bg-dark: #305f80; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  transition: var(--transition);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== DARK MODE: real dark palette per mode ===== */
body.dark[data-mode="pomodoro"]   { --bg: #2b1717; --bg-dark: #1f1010; }
body.dark[data-mode="shortBreak"] { --bg: #122a2b; --bg-dark: #0d1f20; }
body.dark[data-mode="longBreak"]  { --bg: #14222f; --bg-dark: #0e1822; }

/* darker translucent surfaces so cards/tabs read well on dark bg */
body.dark { --card: rgba(255, 255, 255, 0.07); }

/* ===== progress bar ===== */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 4px; width: 0%;
  background: rgba(255, 255, 255, 0.85);
  z-index: 50; transition: width 0.4s linear;
}

/* ===== header ===== */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 18px 20px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.25rem;
}
.brand-mark { font-size: 1.5rem; }
.brand-name strong { font-weight: 800; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 10px;
  border-radius: 8px;
  opacity: 0.9;
  transition: background 0.15s, opacity 0.15s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.18); opacity: 1; }

/* ===== secondary content pages (guide, about, privacy, terms) ===== */
.container {
  max-width: 820px;
  margin: 20px auto 40px;
  padding: 0 20px;
  color: var(--text);
}
.breadcrumbs { font-size: 0.85rem; opacity: 0.75; margin-bottom: 12px; }
.breadcrumbs a { color: inherit; }
.content .updated { font-size: 0.9rem; opacity: 0.7; margin-bottom: 20px; }
.content ul { padding-left: 22px; line-height: 1.7; margin-bottom: 12px; color: #333; }
.content ul li { margin-bottom: 8px; }
.content ol.steps li { margin-bottom: 8px; }
.content a { color: var(--primary, #ba4949); }
.back-link { margin-top: 28px; font-weight: 600; }
body.dark .content ul { color: #c4c4ca; }

/* ===== blog list ===== */
.post-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 16px; }
.post-card {
  background: #f6f6f6;
  border-radius: 12px;
  padding: 20px 22px;
  transition: transform 0.1s, box-shadow 0.15s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.1); }
.post-card h2 { margin: 0 0 6px; font-size: 1.2rem; }
.post-card h2 a { color: var(--text-dark); text-decoration: none; }
.post-card h2 a:hover { color: var(--primary, #ba4949); }
.post-card p { margin: 0 0 10px; color: #444; line-height: 1.6; }
.post-card .read-more { font-weight: 600; color: var(--primary, #ba4949); text-decoration: none; }
.post-meta { font-size: 0.82rem; opacity: 0.7; margin-bottom: 4px; }
body.dark .post-card { background: #26262c; }
body.dark .post-card p { color: #c4c4ca; }
body.dark .post-card h2 a { color: #eaeaef; }

.icon-btn {
  background: var(--card); border: none; color: var(--text);
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.22); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.big { width: 48px; height: 48px; font-size: 1.4rem; }

.lang-select {
  background: var(--card); color: var(--text); border: none;
  border-radius: 10px; padding: 9px 10px; font-family: var(--font);
  font-size: 0.9rem; cursor: pointer;
}
.lang-select option { color: #1c1c1c; }

.support-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px; border-radius: 10px;
  background: var(--card); color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-family: var(--font); font-weight: 600; font-size: 0.9rem;
  text-decoration: none; cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.support-pill:hover { background: rgba(255, 255, 255, 0.22); }
.support-pill:active { transform: scale(0.96); }
.support-pill__heart { color: #ff6b6b; font-size: 1rem; line-height: 1; }
@media (max-width: 480px) {
  .support-pill__label { display: none; }
  .support-pill { padding: 0 12px; }
}

/* ===== layout ===== */
main { max-width: 1100px; margin: 0 auto; padding: 10px 20px 60px; }

.app { max-width: var(--maxw); margin: 10px auto 30px; }

/* ===== timer card ===== */
.timer-card {
  background: var(--card); border-radius: var(--radius);
  padding: 26px 20px 32px; text-align: center; backdrop-filter: blur(4px);
}

.mode-tabs {
  display: flex; gap: 4px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 26px;
}
.mode-tab {
  background: transparent; border: none; color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
  font-family: var(--font); font-size: 0.95rem; font-weight: 500; opacity: 0.85;
  transition: background 0.2s, opacity 0.2s;
}
.mode-tab:hover { opacity: 1; }
.mode-tab.is-active { background: rgba(0, 0, 0, 0.18); opacity: 1; font-weight: 600; }

.time-display {
  font-size: clamp(5rem, 18vw, 9rem); font-weight: 800; line-height: 1;
  letter-spacing: 2px; font-variant-numeric: tabular-nums;
}
.session-label { margin-top: 6px; font-size: 1rem; opacity: 0.9; }

.controls {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 24px;
}
.btn-primary {
  background: var(--accent); color: var(--bg); border: none;
  font-family: var(--font); font-weight: 700; font-size: 1.3rem;
  letter-spacing: 2px; padding: 14px 44px; border-radius: 10px; cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18); transition: transform 0.08s, box-shadow 0.08s;
  min-width: 200px;
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.btn-primary.is-running { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18); transform: translateY(2px); }

.round-counter { margin-top: 22px; opacity: 0.9; font-size: 0.95rem; }
.daily-stats { margin-top: 8px; opacity: 0.8; font-size: 0.85rem; }

/* ===== task panel ===== */
.task-panel { margin-top: 28px; color: var(--text); }
.task-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid rgba(255, 255, 255, 0.35); padding-bottom: 8px; margin-bottom: 14px;
}
.task-head h2 { font-size: 1.1rem; font-weight: 700; }
.task-hint { font-size: 0.85rem; opacity: 0.85; }
.task-form { display: flex; gap: 8px; margin-bottom: 12px; }
.task-form input {
  flex: 1; border: none; border-radius: 10px; padding: 12px 14px;
  font-family: var(--font); font-size: 0.95rem; background: rgba(255, 255, 255, 0.92);
  color: var(--text-dark);
}
.btn-add {
  border: none; border-radius: 10px; padding: 0 18px; cursor: pointer;
  background: rgba(0, 0, 0, 0.2); color: var(--text); font-weight: 600; font-family: var(--font);
}
.btn-add:hover { background: rgba(0, 0, 0, 0.3); }
.task-actions { margin-bottom: 12px; }
.btn-clear {
  border: none; border-radius: 8px; padding: 6px 12px; cursor: pointer;
  background: rgba(231, 76, 60, 0.15); color: #e74c3c; font-weight: 600; font-family: var(--font); font-size: 0.85rem;
}
.btn-clear:hover { background: rgba(231, 76, 60, 0.25); }

.task-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.task-list li {
  background: rgba(255, 255, 255, 0.92); color: var(--text-dark);
  border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  border-left: 6px solid var(--bg); cursor: pointer; transition: opacity 0.2s;
}
.task-list li.active { border-left-color: #2ecc71; }
.task-list li.done { opacity: 0.55; }
.task-list li.done .task-text { text-decoration: line-through; }
.task-list .task-text { flex: 1; font-size: 0.95rem; }
.task-list .task-counter { font-size: 0.85rem; opacity: 0.7; margin-left: 4px; }
.task-list .task-check { width: 20px; height: 20px; cursor: pointer; }
.task-list .task-edit {
  background: none; border: none; cursor: pointer; color: #999; font-size: 1rem; line-height: 1; margin-right: 4px;
}
.task-list .task-edit:hover { color: #3498db; }
.task-list .task-del {
  background: none; border: none; cursor: pointer; color: #999; font-size: 1.1rem; line-height: 1;
}
.task-list .task-del:hover { color: #e74c3c; }

/* ===== ad slots ===== */
.ad-slot {
  max-width: var(--maxw); margin: 0 auto 30px; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08); border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 10px;
}
.ad-placeholder { opacity: 0.6; font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; }

/* ===== SEO content ===== */
.content {
  max-width: 760px; margin: 10px auto 40px; background: rgba(255, 255, 255, 0.95);
  color: var(--text-dark); border-radius: var(--radius); padding: 34px 30px; box-shadow: var(--shadow);
}
.content h1 { font-size: 1.9rem; margin-bottom: 14px; }
.content h2 { font-size: 1.35rem; margin: 28px 0 12px; }
.content p { line-height: 1.7; margin-bottom: 12px; color: #333; }
.steps { padding-left: 22px; line-height: 1.9; color: #333; }
.feature-grid {
  list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px; margin-top: 8px;
}
.feature-grid li {
  display: flex; align-items: center; gap: 10px; background: #f6f6f6;
  padding: 14px; border-radius: 10px; font-size: 0.95rem; color: #333;
}
.feat-ico { font-size: 1.3rem; }

.faq details {
  border: 1px solid #eee; border-radius: 10px; padding: 4px 16px; margin-bottom: 10px; background: #fafafa;
}
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; color: #222; }
.faq details p { padding-bottom: 14px; color: #444; }

/* ===== footer ===== */
.site-footer { text-align: center; padding: 24px; opacity: 0.9; font-size: 0.9rem; }
.view-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
}
.view-counter__num { font-weight: 700; font-variant-numeric: tabular-nums; }

.support-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, transform 0.08s;
}
.support-link:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}
.support-link__heart { color: #ff6b6b; font-size: 1rem; line-height: 1; }

.footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.footer-links a { color: inherit; opacity: 0.8; text-decoration: none; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }

/* ===== modal ===== */
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal[hidden] { display: none; }
.modal-card {
  background: #fff; color: var(--text-dark); border-radius: var(--radius);
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid #eee;
}
.modal-head h2 { font-size: 1.15rem; }
.modal-head .icon-btn { background: #f0f0f0; color: #555; }
.modal-body { padding: 22px; }
.modal-body h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: #999; margin: 18px 0 10px; }
.modal-body h3:first-child { margin-top: 0; }
.setting-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.modal-body label {
  display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 500; color: #555;
}
.modal-body input[type="number"], .modal-body select {
  border: 1px solid #ddd; border-radius: 8px; padding: 10px; font-family: var(--font); font-size: 0.95rem;
  background: #f7f7f7; color: var(--text-dark);
}
.row-setting { flex-direction: row !important; align-items: center; justify-content: space-between; margin-top: 16px; }
.row-setting input { width: 80px; }
.toggle-setting {
  flex-direction: row !important; align-items: center; justify-content: space-between;
  padding: 14px 0; border-top: 1px solid #f0f0f0; font-size: 0.95rem !important; color: #333 !important;
}
/* iOS-style toggle switch */
.toggle-setting input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; position: relative;
  width: 46px; height: 26px; border-radius: 26px; background: #cfcfcf;
  cursor: pointer; transition: background 0.2s; flex: 0 0 auto;
}
.toggle-setting input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: left 0.2s;
}
.toggle-setting input[type="checkbox"]:checked { background: var(--bg); }
.toggle-setting input[type="checkbox"]:checked::after { left: 23px; }

/* full-width settings (video url) */
.full-setting { margin-top: 4px; }
.full-setting input {
  border: 1px solid #ddd; border-radius: 8px; padding: 11px 12px;
  font-family: var(--font); font-size: 0.92rem; background: #f7f7f7; color: var(--text-dark); width: 100%;
}
.setting-note { font-size: 0.78rem; color: #999; margin-top: 8px; line-height: 1.5; }

/* visible YouTube background-music player */
.music-player {
  max-width: 480px; margin: 24px auto 0;
  background: rgba(0, 0, 0, 0.18); border-radius: 12px; padding: 8px;
}
.music-player[hidden] { display: none; }
.music-player .yt-frame {
  position: relative; width: 100%; padding-top: 56.25%; /* 16:9 */
  border-radius: 8px; overflow: hidden; background: #000;
}
.music-player .yt-frame iframe,
.music-player .yt-frame #ytPlayer {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0;
}
.btn-secondary {
  margin-top: 14px; background: #f0f0f0; border: none; border-radius: 8px;
  padding: 10px 16px; cursor: pointer; font-family: var(--font); font-weight: 600; color: #444;
}
.modal-foot { padding: 0 22px 22px; }
.modal-foot .btn-primary { width: 100%; min-width: 0; background: var(--bg); color: #fff; }

/* ===== DARK MODE surfaces (content, tasks, modal) ===== */
body.dark { --text-dark: #e8e8ec; }
body.dark .content { background: #1c1c21; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
body.dark .content p, body.dark .steps { color: #c4c4ca; }
body.dark .feature-grid li { background: #26262c; color: #d6d6db; }
body.dark .faq details { background: #1f1f25; border-color: #34343c; }
body.dark .faq summary { color: #eaeaef; }
body.dark .faq details p { color: #b9b9c0; }
body.dark .task-list li { background: rgba(255,255,255,0.06); color: var(--text); }
body.dark .task-list .task-del { color: #888; }
body.dark .task-form input { background: rgba(255,255,255,0.1); color: var(--text); }
body.dark .task-form input::placeholder { color: #aaa; }
body.dark .modal-card { background: #1d1d22; }
body.dark .modal-head { border-color: #2e2e34; }
body.dark .modal-head .icon-btn { background: #2a2a30; color: #ccc; }
body.dark .modal-body input[type="number"],
body.dark .modal-body select,
body.dark .full-setting input { background: #26262c; border-color: #3a3a42; color: #e8e8ec; }
body.dark .modal-body label { color: #b6b6bd; }
body.dark .toggle-setting { border-color: #2a2a30; color: #d6d6db !important; }
body.dark .modal-body h3, body.dark .setting-note { color: #8a8a90; }
body.dark .btn-secondary { background: #2a2a30; color: #d6d6db; }

/* ===== responsive ===== */
@media (max-width: 560px) {
  .btn-primary { min-width: 160px; padding: 14px 30px; }
  .content { padding: 24px 18px; }
  .setting-grid { grid-template-columns: 1fr; }
}
