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

:root {
  --bg: #0a0a0f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.06);
  --text: #e0e0e0;
  --text-dim: #888;
  --text-faint: #555;
  --accent: #8b5cf6;
  --accent-dim: rgba(139, 92, 246, 0.15);
  --danger: #ef4444;
  --success: #22c55e;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body.bg-midnight { --bg: #0d1117; }
body.bg-deep { --bg: #1a1035; }
body.bg-ocean { --bg: #0a192f; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.top-section {
  text-align: center;
  margin-bottom: 40px;
}

.greeting {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.clock {
  font-size: 72px;
  font-weight: 300;
  letter-spacing: -2px;
  color: #fff;
  line-height: 1;
}

.date {
  font-size: 15px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h2 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

/* Tasks */
.task-count {
  font-size: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.task-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.task-input-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

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

.add-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
  font-family: inherit;
}

.add-btn:hover {
  opacity: 0.85;
}

.task-list {
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.task-item:last-child {
  border-bottom: none;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-faint);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-checkbox:hover {
  border-color: var(--accent);
}

.task-item.done .task-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.task-item.done .task-checkbox::after {
  content: '\2713';
  color: #fff;
  font-size: 11px;
}

.task-text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  transition: all 0.2s;
}

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

.task-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: all 0.15s;
}

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

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

.task-footer {
  padding-top: 8px;
}

.clear-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.clear-btn:hover {
  color: var(--text-dim);
}

/* Focus Timer */
.timer-display {
  text-align: center;
  margin-bottom: 16px;
}

.timer-time {
  font-size: 56px;
  font-weight: 300;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
  letter-spacing: 2px;
}

.timer-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.timer-btn {
  padding: 10px 28px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  background: var(--accent);
  color: #fff;
}

.timer-btn:hover {
  opacity: 0.85;
}

.timer-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.timer-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.timer-presets {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}

.preset-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

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

.preset-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.focus-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

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

/* Quick Links */
.add-link-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: none;
  color: var(--text-faint);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

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

.links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.link-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  position: relative;
}

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

.link-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}

.link-name {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.link-item:hover .link-remove {
  display: flex;
}

.add-link-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-link-form input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

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

.form-actions {
  display: flex;
  gap: 8px;
}

.save-link-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.cancel-link-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

/* Quick Note */
.notes-card textarea {
  width: 100%;
  min-height: 140px;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
}

.notes-card textarea::placeholder {
  color: var(--text-faint);
}

.save-indicator {
  font-size: 11px;
  color: var(--text-faint);
  transition: color 0.3s;
}

.save-indicator.saving {
  color: var(--accent);
}

/* Footer */
.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 0;
  margin-top: 24px;
}

.quote {
  font-size: 13px;
  color: var(--text-faint);
  font-style: italic;
  max-width: 70%;
}

.settings-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--surface);
  color: var(--text-faint);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Settings Panel */
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.settings-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.settings-content {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 360px;
  background: #111118;
  border-left: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.settings-header h2 {
  font-size: 18px;
  color: #fff;
}

.settings-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.setting-group {
  margin-bottom: 24px;
}

.setting-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.setting-group input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.setting-group input[type="text"]:focus {
  border-color: var(--accent);
}

.toggle-group {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}

.toggle-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

.color-options {
  display: flex;
  gap: 8px;
}

.color-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s;
}

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

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

.danger-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.danger-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .clock {
    font-size: 52px;
  }

  .links-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .settings-content {
    width: 100%;
  }
}
