
:root {
  /* Colors */
  --bg-base:        #0e0f11;
  --bg-panel:       #16181c;
  --bg-panel-hover: #1c1f24;
  --bg-input:       #1e2127;
  --border:         #2a2d35;
  --border-active:  #3d4149;

  --accent:         #f0a500;
  --accent-dim:     rgba(240, 165, 0, 0.15);
  --accent-glow:    rgba(240, 165, 0, 0.35);

  --text-primary:   #e8eaed;
  --text-secondary: #7c8290;
  --text-muted:     #4a4f5a;

  --green:          #4ade80;
  --red:            #f87171;
  --blue:           #60a5fa;

  /* Timer states */
  --timer-focus:    #f0a500;
  --timer-break:    #4ade80;

  /* Typography */
  --font-display:   'Syne', sans-serif;
  --font-mono:      'DM Mono', monospace;

  /* Spacing scale */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Transitions */
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --duration:  200ms;
}

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

html { height: 100%; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(240,165,0,0.06) 0%, transparent 60%);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(14,15,17,0.92);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.app-layout {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: var(--space-lg);
  padding: var(--space-xl);
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.app-footer {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-icon {
  color: var(--accent);
  font-size: 22px;
  animation: pulse-icon 3s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.current-date {
  color: var(--text-secondary);
  font-size: 12px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

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

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.panel--timer {
  align-items: center;
  gap: var(--space-lg);
}

.timer-mode-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.tab {
  flex: 1;
  padding: var(--space-xs) var(--space-md);
  border: none;
  border-radius: calc(var(--radius-md) - 3px);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.tab--active {
  background: var(--bg-panel-hover);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.timer-display {
  font-family: var(--font-mono);
  font-size: clamp(72px, 12vw, 96px);
  font-weight: 500;
  letter-spacing: -4px;
  color: var(--timer-focus);
  text-shadow: 0 0 40px var(--accent-glow);
  transition: color 0.4s var(--ease), text-shadow 0.4s var(--ease);
  line-height: 1;
}

.timer-display.break-mode {
  color: var(--timer-break);
  text-shadow: 0 0 40px rgba(74, 222, 128, 0.3);
}

.timer-colon {
  animation: blink-colon 1s step-end infinite;
}

.timer-colon.paused { animation: none; opacity: 0.3; }

@keyframes blink-colon {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.timer-label {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}

.timer-controls {
  display: flex;
  gap: var(--space-sm);
  width: 100%;
}

.session-counter {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

/* Session dots */
.session-counter::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 12px 0 0 var(--accent), 24px 0 0 var(--border), 36px 0 0 var(--border);
}

.btn-primary {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  background: #ffc234;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary.btn-sm { flex: 0 0 auto; padding: var(--space-xs) var(--space-md); }

.btn-ghost {
  padding: var(--space-xs) var(--space-md);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  flex: 1;
}

.btn-ghost:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
  background: var(--bg-panel-hover);
}

.badge {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(240,165,0,0.3);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
}

.task-input-row {
  display: flex;
  gap: var(--space-sm);
}

input[type="text"] {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: var(--space-xs) var(--space-md);
  outline: none;
  transition: border-color var(--duration);
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

input[type="text"]::placeholder { color: var(--text-muted); }

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
  overflow-y: auto;
  max-height: 380px;
}

.task-list::-webkit-scrollbar { width: 4px; }
.task-list::-webkit-scrollbar-track { background: transparent; }
.task-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.task-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
  animation: slide-in 0.2s var(--ease);
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.task-item:hover { border-color: var(--border-active); }

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

.task-item--done {
  opacity: 0.4;
}

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

.task-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-active);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all var(--duration);
}

.task-checkbox.checked {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}

.task-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

.task-delete {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 2px;
  transition: opacity var(--duration), color var(--duration);
  line-height: 1;
}

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

.task-delete:hover { color: var(--red); }

.empty-state {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: var(--space-lg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.stat-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.stat-card--accent {
  border-color: rgba(240,165,0,0.3);
  background: var(--accent-dim);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.chart-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.chart-title, .history-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.weekly-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 60px;
}

.chart-bar {
  flex: 1;
  background: var(--accent-dim);
  border-radius: 3px 3px 0 0;
  border: 1px solid rgba(240,165,0,0.2);
  min-height: 4px;
  transition: height 0.5s var(--ease), background 0.2s;
  cursor: pointer;
  position: relative;
}

.chart-bar:hover {
  background: var(--accent-glow);
}

.chart-bar--today {
  background: var(--accent);
  border-color: var(--accent);
}

.weekly-chart-labels {
  display: flex;
  gap: 4px;
}

.chart-label {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
}

.session-log {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}

.session-log::-webkit-scrollbar { width: 4px; }
.session-log::-webkit-scrollbar-thumb { background: var(--border); }

.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px var(--space-md);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 12px;
  animation: slide-in 0.2s var(--ease);
}

.log-item-task { color: var(--text-secondary); }
.log-item-time { color: var(--text-muted); }
.log-item-duration { color: var(--accent); font-weight: 500; }

.shortcut {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 11px;
  color: var(--text-muted);
}

kbd {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.toast {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-panel-hover);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease);
  z-index: 100;
  white-space: nowrap;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .panel--timer {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .app-layout {
    grid-template-columns: 1fr;
    padding: var(--space-md);
  }

  .timer-display { font-size: 72px; }
  .app-header { padding: var(--space-md); }
  .app-footer { display: none; }
}