/* Life Dashboard — styles */

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

/* -------------------------------------------------------------------------
   Base
------------------------------------------------------------------------- */
:root {
  --accent: #5b6ef5;
  --accent-hover: #7080ff;
  --danger: #e05c6a;
  --danger-hover: #c94d5a;
  --radius: 14px;
  --gap: 1rem;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-muted: #666;
  --border: #e0e0e0;
}

body {
  background: linear-gradient(135deg, #6a7fd4 0%, #8b5cf6 50%, #7c3aed 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
  padding: 1.5rem;
}

/* -------------------------------------------------------------------------
   Dashboard layout
------------------------------------------------------------------------- */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-width: 1000px;
  margin: 0 auto;
}

/* Row with timer + tasks side by side */
.row-two {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--gap);
}

/* -------------------------------------------------------------------------
   Module card
------------------------------------------------------------------------- */
.module {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.module h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* -------------------------------------------------------------------------
   Greeting Module
------------------------------------------------------------------------- */
.module--greeting {
  text-align: center;
  gap: 0.25rem;
  padding: 1.75rem 1.5rem;
}

#time-display {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

#date-display {
  font-size: 0.95rem;
  color: var(--text-muted);
}

#greeting-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.25rem;
}

/* -------------------------------------------------------------------------
   Focus Timer
------------------------------------------------------------------------- */
#focus-timer {
  align-items: center;
  text-align: center;
}

#timer-display {
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#timer-completion {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4caf7d;
  background: rgba(76, 175, 125, 0.1);
  border: 1px solid rgba(76, 175, 125, 0.3);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
}

.timer-controls {
  display: flex;
  gap: 0.5rem;
}

.timer-controls button {
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #f5f5f5;
  color: var(--text);
  transition: background 0.15s;
}

.timer-controls button:hover {
  background: #e8e8e8;
}

#timer-start {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  font-weight: 600 !important;
}

#timer-start:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}

/* -------------------------------------------------------------------------
   Task Manager
------------------------------------------------------------------------- */
#task-form {
  display: flex;
  gap: 0.5rem;
}

#task-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
}

#task-input::placeholder { color: #aaa; }
#task-input:focus { outline: none; border-color: var(--accent); }

#task-form button[type="submit"] {
  padding: 0.5rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

#task-form button[type="submit"]:hover {
  background: var(--accent-hover);
}

#task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#task-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid #f0f0f0;
}

.task-drag-handle {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f5f5f5;
  color: var(--text-muted);
  cursor: grab;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-size: 0.85rem;
}

.task-drag-handle:active {
  cursor: grabbing;
}

#task-list li.task-dragging {
  opacity: 0.4;
}

#task-list li.task-drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Checkbox toggle button styled as checkbox */
.task-toggle-btn {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  font-size: 0;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

#task-list li.completed .task-toggle-btn {
  background: var(--accent);
  border-color: var(--accent);
}

.task-label {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-word;
}

#task-list li.completed .task-label {
  text-decoration: line-through;
  color: #aaa;
}

.task-edit-input {
  flex: 1;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
}

.task-edit-input:focus { outline: none; }

.task-edit-btn,
.task-confirm-btn {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f5f5f5;
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}

.task-edit-btn:hover,
.task-confirm-btn:hover {
  background: #e8e8e8;
}

.task-delete-btn {
  padding: 0.3rem 0.65rem;
  background: var(--danger);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

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

/* -------------------------------------------------------------------------
   Quick Links
------------------------------------------------------------------------- */
.row-bottom {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--gap);
  align-items: start;
}

#quick-links {
  align-self: start;
}

#links-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#link-label-input,
#link-url-input {
  flex: 1;
  min-width: 80px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
}

#link-label-input::placeholder,
#link-url-input::placeholder { color: #aaa; }

#link-label-input:focus,
#link-url-input:focus { outline: none; border-color: var(--accent); }

#links-form button[type="submit"] {
  padding: 0.5rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

#links-form button[type="submit"]:hover {
  background: var(--accent-hover);
}

#links-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#links-list li {
  position: relative;
  display: inline-flex;
  align-items: center;
}

#links-list a {
  display: inline-block;
  padding: 0.45rem 1.8rem 0.45rem 0.9rem;
  background: var(--accent);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s;
  white-space: nowrap;
}

#links-list a:hover {
  background: var(--accent-hover);
}

.link-delete-btn {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e05c6a;
  border: 2px solid #fff;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}

.link-delete-btn:hover {
  background: var(--danger-hover);
}

/* -------------------------------------------------------------------------
   Greeting — name form
------------------------------------------------------------------------- */
#name-form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

#name-input {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  width: 180px;
  transition: border-color 0.15s;
}

#name-input::placeholder { color: #aaa; }
#name-input:focus { outline: none; border-color: var(--accent); }

#name-form button[type="submit"] {
  padding: 0.4rem 0.9rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

#name-form button[type="submit"]:hover {
  background: var(--accent-hover);
}

/* -------------------------------------------------------------------------
   Timer — duration form
------------------------------------------------------------------------- */
#timer-duration-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

#timer-duration-input {
  width: 70px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text);
  text-align: center;
  background: #fff;
  transition: border-color 0.15s;
}

#timer-duration-input:focus { outline: none; border-color: var(--accent); }

#timer-duration-form button[type="submit"] {
  padding: 0.4rem 0.8rem;
  background: #f0f0f0;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

#timer-duration-form button[type="submit"]:hover {
  background: #e0e0e0;
}

/* -------------------------------------------------------------------------
   Task duplicate message
------------------------------------------------------------------------- */
#task-duplicate-msg {
  font-size: 0.8rem;
  color: var(--danger);
  font-weight: 500;
  margin-top: -0.25rem;
}


.hidden {
  display: none !important;
}

/* -------------------------------------------------------------------------
   Responsive
------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .row-two,
  .row-bottom {
    grid-template-columns: 1fr;
  }

  #time-display,
  #timer-display {
    font-size: 2.2rem;
  }
}
