/* ===== CSS Reset & Variables ===== */
:root {
  --primary: #E74C3C;
  --primary-hover: #C0392B;
  --primary-light: #FADBD8;
  --bg: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-tertiary: #EEEEEE;
  --text: #1A1A2E;
  --text-secondary: #6C757D;
  --text-muted: #ADB5BD;
  --border: #DEE2E6;
  --border-light: #E9ECEF;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #1A1A2E;
  --bg-secondary: #16213E;
  --bg-tertiary: #0F3460;
  --text: #E8E8E8;
  --text-secondary: #A0A0B0;
  --text-muted: #6C6C80;
  --border: #2A2A4A;
  --border-light: #222244;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Navigation ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: background var(--transition);
  height: 60px;
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.nav-brand {
  font-size: 1.25rem; font-weight: 700; color: var(--primary);
  display: flex; align-items: center; gap: 8px;
}
.nav-brand:hover { color: var(--primary-hover); }
.nav-brand img { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  color: var(--text-secondary); font-size: 0.875rem;
  padding: 6px 14px; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.nav-links a:hover { color: var(--text); background: var(--bg-secondary); }
.nav-right { display: flex; align-items: center; gap: 8px; }

.theme-toggle, .lang-select {
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg);
  color: var(--text); font-size: 0.8125rem;
  transition: all var(--transition);
}
.theme-toggle:hover, .lang-select:hover { border-color: var(--primary); }
.lang-select { cursor: pointer; }

/* ===== Hero ===== */
.hero {
  padding: 120px 0 60px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 100%);
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, rgba(231,76,60,0.15) 0%, var(--bg) 100%);
}
.hero h1 { font-size: 2.5rem; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.hero p { font-size: 1.125rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 32px; }
.hero .cta { 
  display: inline-block; padding: 14px 36px; 
  background: var(--primary); color: #fff; 
  border-radius: 50px; font-size: 1rem; font-weight: 600;
  transition: all var(--transition); border: none;
}
.hero .cta:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(231,76,60,0.4); color: #fff; }

/* ===== Timer Section ===== */
.timer-section { padding: 60px 0; }
.timer-card {
  max-width: 520px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 40px 32px; transition: all var(--transition);
}
.timer-tabs {
  display: flex; gap: 4px; margin-bottom: 28px;
  background: var(--bg-secondary); border-radius: var(--radius);
  padding: 4px;
}
.timer-tab {
  flex: 1; padding: 8px 12px; text-align: center;
  border-radius: var(--radius-sm); font-size: 0.8125rem;
  font-weight: 500; color: var(--text-secondary);
  background: transparent; border: none;
  transition: all var(--transition);
}
.timer-tab.active { background: var(--primary); color: #fff; }
.timer-tab:hover:not(.active) { color: var(--text); background: var(--bg-tertiary); }

.timer-display {
  position: relative; width: 280px; height: 280px; margin: 0 auto 28px;
}
.timer-ring-bg { fill: none; stroke: var(--border-light); stroke-width: 6; }
.timer-ring-progress {
  fill: none; stroke: var(--primary); stroke-width: 6;
  stroke-linecap: round; transform: rotate(-90deg); transform-origin: center;
  transition: stroke-dashoffset 1s linear;
}
.timer-time {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 4rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text); letter-spacing: -1px;
}
.timer-time.paused { opacity: 0.7; }
.timer-status {
  position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%);
  font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 1px;
}

.timer-buttons { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.btn {
  padding: 10px 24px; border-radius: 50px; font-size: 0.9375rem;
  font-weight: 600; border: none; transition: all var(--transition);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text-secondary);
  border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 16px; font-size: 0.8125rem; }
.btn-icon { padding: 8px; background: transparent; border: none; color: var(--text-secondary); border-radius: 50%; }
.btn-icon:hover { background: var(--bg-secondary); color: var(--text); }

.timer-sessions { text-align: center; font-size: 0.8125rem; color: var(--text-muted); }

/* ===== Tasks ===== */
.tasks-section { padding: 0 0 60px; }
.tasks-card {
  max-width: 520px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 28px 32px;
}
.tasks-card h3 { font-size: 1.125rem; margin-bottom: 16px; }
.task-input-row { display: flex; gap: 8px; margin-bottom: 16px; }
.task-input-row input {
  flex: 1; padding: 10px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.9375rem;
  background: var(--bg); color: var(--text);
  transition: border-color var(--transition);
}
.task-input-row input:focus { outline: none; border-color: var(--primary); }
.task-input-row input::placeholder { color: var(--text-muted); }
.task-input-row select {
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: 0.875rem;
}
.task-add-btn {
  padding: 10px 20px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.875rem; transition: all var(--transition);
}
.task-add-btn:hover { background: var(--primary-hover); }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: var(--bg-secondary);
  border-radius: var(--radius-sm); transition: all var(--transition);
}
.task-item.completed { opacity: 0.5; }
.task-item.completed .task-name { text-decoration: line-through; }
.task-checkbox {
  width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer;
}
.task-name { flex: 1; font-size: 0.9375rem; }
.task-pomos { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.task-delete {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 4px; font-size: 1rem;
  transition: all var(--transition);
}
.task-delete:hover { color: var(--primary); background: var(--primary-light); }

/* ===== Content Sections ===== */
.content-section { padding: 60px 0; }
.content-section:nth-child(even) { background: var(--bg-secondary); }
.content-section h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 24px; text-align: center; }
.content-section h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 12px; }
.content-section p { color: var(--text-secondary); margin-bottom: 16px; }
.content-section .container { max-width: 800px; }

.benefits-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px; margin-top: 32px;
}
.benefit-card {
  padding: 24px; background: var(--bg); border-radius: var(--radius);
  border: 1px solid var(--border-light); text-align: center;
  transition: all var(--transition);
}
.benefit-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.benefit-icon { font-size: 2rem; margin-bottom: 12px; }
.benefit-card h4 { font-size: 1rem; margin-bottom: 8px; }
.benefit-card p { font-size: 0.875rem; margin-bottom: 0; }

.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px; margin-top: 32px;
}
.step-card {
  padding: 24px; background: var(--bg); border-radius: var(--radius);
  border: 1px solid var(--border-light); text-align: center;
}
.step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: var(--primary);
  color: #fff; border-radius: 50%; font-weight: 700; margin-bottom: 12px;
}
.step-card h4 { font-size: 1rem; margin-bottom: 8px; }
.step-card p { font-size: 0.875rem; margin-bottom: 0; }

/* ===== Blog Preview ===== */
.blog-preview { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.blog-preview-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); transition: all var(--transition);
}
.blog-preview-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.blog-preview-item .blog-title { font-weight: 500; color: var(--text); }
.blog-preview-item .blog-date { font-size: 0.8125rem; color: var(--text-muted); white-space: nowrap; }
.blog-view-all { text-align: center; margin-top: 16px; }
.blog-view-all a { font-weight: 600; }

/* ===== FAQ ===== */
.faq-list { margin-top: 24px; }
.faq-item {
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  margin-bottom: 8px; overflow: hidden;
}
.faq-question {
  width: 100%; padding: 16px 20px; text-align: left;
  background: var(--bg); border: none; font-size: 1rem;
  font-weight: 500; color: var(--text); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: all var(--transition);
}
.faq-question:hover { background: var(--bg-secondary); }
.faq-arrow { transition: transform 0.3s ease; font-size: 0.75rem; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
  padding: 0 20px;
}
.faq-item.open .faq-answer { max-height: 300px; padding: 0 20px 16px; }
.faq-answer p { font-size: 0.9375rem; margin: 0; }

/* ===== Modals ===== */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 2000;
  justify-content: center; align-items: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-width: 480px; width: 100%;
  max-height: 80vh; overflow-y: auto; padding: 32px;
  transition: background var(--transition);
}
.modal h2 { font-size: 1.25rem; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; }
.modal-close {
  background: transparent; border: none; font-size: 1.5rem;
  color: var(--text-muted); cursor: pointer; padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg-secondary); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-group input[type="number"] {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
  font-size: 0.9375rem;
}
.form-group input[type="number"]:focus { outline: none; border-color: var(--primary); }
.form-group input[type="range"] { width: 100%; accent-color: var(--primary); }
.form-group select {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
  font-size: 0.9375rem;
}

.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.setting-row:last-child { border-bottom: none; }
.setting-row label { font-size: 0.9375rem; }
.toggle-switch {
  position: relative; width: 44px; height: 24px;
  display: inline-block;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border); border-radius: 24px; transition: all 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: #fff;
  border-radius: 50%; transition: all 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.btn-save {
  width: 100%; padding: 12px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 1rem; margin-top: 8px; transition: all var(--transition);
}
.btn-save:hover { background: var(--primary-hover); }

.shortcuts-list { display: flex; flex-direction: column; gap: 12px; }
.shortcut-item { display: flex; justify-content: space-between; align-items: center; }
.shortcut-key { display: flex; gap: 4px; }
kbd {
  padding: 4px 10px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 0.8125rem; font-family: monospace;
}

/* ===== Legal Links ===== */
.legal-links { text-align: center; padding: 40px 0 16px; }
.legal-links a {
  color: var(--text-muted); font-size: 0.8125rem; margin: 0 12px;
  transition: color var(--transition);
}
.legal-links a:hover { color: var(--primary); }

/* ===== Footer ===== */
.footer {
  padding: 24px 0 40px; text-align: center;
  border-top: 1px solid var(--border-light);
}
.footer p { font-size: 0.8125rem; color: var(--text-muted); }
.footer a { color: var(--text-secondary); }
.footer .social { margin-top: 12px; display: flex; gap: 16px; justify-content: center; }
.footer .social a { font-size: 0.8125rem; }

/* ===== Burger Menu (Mobile) ===== */
.burger { display: none; background: transparent; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); padding: 4px; }
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .burger { display: block; }
  .nav-right { gap: 4px; }
  .hero h1 { font-size: 1.75rem; }
  .hero { padding: 100px 0 40px; }
  .timer-display { width: 240px; height: 240px; }
  .timer-time { font-size: 3rem; }
  .timer-card, .tasks-card { padding: 24px 20px; }
}

/* ===== Blog Article Content (shell injected by template.js) ===== */
.blog-article-wrapper { padding: 100px 0 60px; min-height: 60vh; }
.blog-article-wrapper .container { max-width: 800px; }
.blog-breadcrumb { margin-bottom: 32px; }
.blog-breadcrumb a { color: var(--text-muted); font-size: 0.875rem; }
.blog-breadcrumb a:hover { color: var(--primary); }
.blog-article-content h1 { font-size: 2rem; font-weight: 700; margin-bottom: 24px; line-height: 1.3; }
.blog-article-content h2 { font-size: 1.35rem; font-weight: 600; margin: 32px 0 12px; }
.blog-article-content h3 { font-size: 1.1rem; font-weight: 600; margin: 24px 0 8px; }
.blog-article-content p { font-size: 1.0625rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 18px; }
.blog-article-content ul, .blog-article-content ol { margin: 16px 0 24px; padding-left: 24px; }
.blog-article-content li { font-size: 1.0625rem; line-height: 1.7; color: var(--text-secondary); margin-bottom: 8px; }
.blog-article-content strong { color: var(--text); }
.blog-article-content a { text-decoration: underline; }
.blog-article-content em { font-style: italic; }

/* ===== Legal Page Content (shell injected by template.js) ===== */
.legal-page-wrapper { padding: 100px 0 60px; min-height: 60vh; }
.legal-page-wrapper .container { max-width: 800px; }
.legal-content h1 { font-size: 2rem; font-weight: 700; margin-bottom: 24px; }
.legal-content h2 { font-size: 1.35rem; font-weight: 600; margin: 32px 0 12px; }
.legal-content h3 { font-size: 1.1rem; font-weight: 600; margin: 24px 0 8px; }
.legal-content p { font-size: 1.0625rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 18px; }
.legal-content ul, .legal-content ol { margin: 16px 0 24px; padding-left: 24px; }
.legal-content li { font-size: 1.0625rem; line-height: 1.7; color: var(--text-secondary); margin-bottom: 8px; }
.legal-content strong { color: var(--text); }

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease; }
