/* ── Daily Dashboard - style.css ── */

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-input: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-gradient: linear-gradient(135deg, #38bdf8, #818cf8);
  --success: #34d399;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --bg-input: rgba(0, 0, 0, 0.05);
  --border-color: rgba(0, 0, 0, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #2563eb, #7c3aed);
  --success: #10b981;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

html {
  font-size: 16px;
  background: var(--bg-primary);
}

/* ── Focus Visible ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  padding: 1.5rem;
  transition: background var(--transition), color var(--transition);
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 10px; }

.dashboard {
  max-width: 1280px;
  margin: 0 auto;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.top-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}

.top-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.top-btn .icon { font-size: 1rem; }

/* Greeting */
.greeting {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 1rem 0;
}

.greeting h1 {
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.greeting .time {
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.greeting .date {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Widgets Grid */
.widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .widgets { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  body { padding: 1rem; }
  .widgets { grid-template-columns: 1fr; gap: 1rem; }
  .greeting h1 { font-size: 1.3rem; }
  .greeting .time { font-size: 3.2rem; }
  .greeting .date { font-size: 0.9rem; }
  .top-bar { gap: 0.35rem; }
  .top-btn { padding: 0.45rem 0.7rem; font-size: 0.75rem; min-height: 44px; }
  .top-btn .label { display: none; }
  .pomo-btn { min-height: 44px; }
  .goal-btn { min-height: 44px; }
  .todo-check { min-width: 28px; min-height: 28px; }
  .todo-input input { min-height: 44px; }
  .todo-input button { min-height: 44px; }
  .quick-link { min-height: 44px; padding: 0.5rem 0.9rem; }
  .footer { margin-top: 1.5rem; padding: 1rem 0 0.5rem; font-size: 0.75rem; }
}

/* ── 375px breakpoint (small phones) ── */
@media (max-width: 375px) {
  body { padding: 0.75rem; }
  .greeting h1 { font-size: 1.15rem; }
  .greeting .time { font-size: 2.8rem; }
  .greeting .date { font-size: 0.82rem; }
  .widget { padding: 1.1rem; }
}

/* Widget Cards */
.widget {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.4rem;
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.widget:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.15);
}

.widget:hover::before { opacity: 1; }

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

.widget-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-title .emoji { font-size: 1.1rem; }

.widget-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: var(--bg-input);
  border-radius: 20px;
  color: var(--text-secondary);
}

/* Todo Widget */
.todo-input {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.todo-input input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: all var(--transition);
}

.todo-input input::placeholder { color: var(--text-muted); }
.todo-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1); }

.todo-input button {
  padding: 0.65rem 1rem;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.todo-input button:hover { opacity: 0.85; transform: scale(1.05); }

.todo-list {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
}

.todo-item:hover { background: var(--bg-card-hover); }

.todo-item.done {
  opacity: 0.45;
}

.todo-item.done .todo-text {
  text-decoration: line-through;
}

.todo-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 0.65rem;
}

.todo-item.done .todo-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.todo-text { flex: 1; }

.todo-delete {
  opacity: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  transition: all var(--transition);
}

.todo-item:hover .todo-delete { opacity: 1; }
.todo-delete:hover { color: #ef4444; }

/* Notes Widget */
.note-area {
  width: 100%;
  min-height: 160px;
  padding: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: all var(--transition);
}

.note-area::placeholder { color: var(--text-muted); }
.note-area:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1); }

/* Goals Widget */
.goal-item { margin-bottom: 1rem; }
.goal-item:last-of-type { margin-bottom: 0.75rem; }

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.goal-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: 10px;
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.goal-btn {
  flex: 1;
  padding: 0.55rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.goal-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Pomodoro Widget */
.pomo-timer { text-align: center; }

.pomo-time {
  font-size: 3.5rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.pomo-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pomo-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.pomo-btn {
  padding: 0.55rem 1.5rem;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.pomo-btn.start {
  background: var(--accent-gradient);
  color: #fff;
  min-width: 110px;
}

.pomo-btn.start:hover { opacity: 0.85; transform: scale(1.03); }

.pomo-btn.reset {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.pomo-btn.reset:hover { background: var(--bg-card-hover); }

.pomo-sessions {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Quote Widget */
.quote-text {
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.quote-author {
  text-align: right;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.quote-refresh {
  margin-top: 0.75rem;
  text-align: center;
}

.quote-refresh button {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  transition: all var(--transition);
}

.quote-refresh button:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Quick Links Widget */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-link {
  padding: 0.5rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.quick-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 3rem;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.footer a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Hidden file input */
#importInput { display: none; }

/* Notification toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  font-size: 0.85rem;
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ── Widget Stagger Animation ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.widget.stagger-in {
  opacity: 0;
  animation: slideUp 0.5s ease-out forwards;
}

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