/* Microsoft To Do - inspired UI for ToDoPro */
/* Clean typography, rounded cards, responsive & adaptive */

:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --muted: #6b7280;
  --text: #0f1724;
  --accent: #2563eb;
  --radius: 12px;
  --shadow-soft: 0 6px 20px rgba(16, 24, 40, 0.06);
  --shadow-subtle: 0 2px 8px rgba(2, 6, 23, 0.06);
}

/* Themes */
.app[data-theme="light"] {
  --bg: #f6f8fb;
  --card: #fff;
  --text: #0f1724;
  --muted: #6b7280;
  --accent: #2563eb;
}

.app[data-theme="dark"] {
  --bg: #0a0f1a;
  --card: #111827;
  --text: #f5f9ff;
  /* bright readable text */
  --muted: #c5cee0;
  /* lighter muted text */
  --accent: #7c8cff;
  /* brighter accent */
}

.app[data-theme="dark"] .icon-btn:hover {
  color: var(--accent);
}

.app[data-theme="dark"] .lists li {
  color: var(--text);
}

.app[data-theme="dark"] .lists li.active {
  background: rgba(124, 140, 255, 0.15);
  border-left-color: var(--accent);
}

/* Dark theme active list title */
.app[data-theme="dark"] .active-list-title {
  color: var(--accent);
}

.app[data-theme="dark"] .task-card {
  color: var(--text);
  background: #1a2235;
  /* slightly lighter card */
}

.app[data-theme="dark"] .task-meta {
  color: var(--muted);
}

.app[data-theme="dark"] .overdue {
  color: #ff7373;
}

.app[data-theme="dark"] .checkbox {
  border-color: rgba(255, 255, 255, 0.4);
}

.app[data-theme="dark"] .checkbox.checked {
  background: var(--accent);
  border: none;
}

.app[data-theme="green"] {
  --bg: #ecfdf5;
  --card: #fff;
  --text: #064e3b;
  --muted: #14532d;
  --accent: #10b981;
}

.app[data-theme="purple"] {
  --bg: #f8f3ff;
  --card: #fff;
  --text: #3b0764;
  --muted: #5b21b6;
  --accent: #7c3aed;
}

.app[data-theme="blue"] {
  --bg: #eff6ff;
  --card: #fff;
  --text: #1e3a8a;
  --muted: #1e40af;
  --accent: #2563eb;
}

.app[data-theme="pink"] {
  --bg: #fff1f7;
  --card: #fff;
  --text: #831843;
  --muted: #be185d;
  --accent: #ec4899;
}

.app[data-theme="yellow"] {
  --bg: #fff8e6;
  --card: #fff;
  --text: #7c2d12;
  --muted: #92400e;
  --accent: #facc15;
}

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

html,
body {
  height: 100%;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--text)
}

/* App layout */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh
}

/* Header */
.app-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;

  .app[data-theme="dark"] .icon-btn {
    color: var(--muted);
  }



  background:var(--card);
  border-bottom:1px solid rgba(0, 0, 0, 0.05);
  position:sticky;
  top:0;
  z-index:5;
}

.logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent)
}

.today-display {
  font-size: 14px;
  color: var(--muted)
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap
}

.control-select,
.clear-top {
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}

.clear-top {
  color: var(--muted);
  font-size: 14px;
}

.theme-palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.theme-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform .15s
}

.theme-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-subtle)
}

/* Main Container */
.container {
  display: flex;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  gap: 18px;
  padding: 20px;
  transition: all .3s;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease-in-out;
}

.sidebar.hidden {
  transform: translateX(-260px);
}

.sidebar-section-title {
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.lists {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  max-height: 55vh
}

.lists li {
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .2s
}

.lists li:hover {
  background: rgba(0, 0, 0, 0.05)
}

.lists li.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
  border-left: 4px solid var(--accent);
  font-weight: 600
}

.add-list-btn {
  background: transparent;
  border: 1px dashed rgba(0, 0, 0, 0.1);
  padding: 8px;
  border-radius: 8px;
  margin-top: 8px;
  cursor: pointer
}

.sidebar-footer {
  font-size: 12px;
  color: var(--muted);
  margin-top: auto;
  text-align: center;
  padding-top: 8px
}

/* Main panel */
.main {
  flex: 1;
  display: flex;
  flex-direction: column
}

.main-panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Quick add section */
.quick-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer
}

.task-input,
.date-input,
.list-select {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 10px;
  font-size: 15px;
}

.task-input {
  flex: 1;
  min-width: 180px
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 500;
  transition: background .15s;
}

.btn-primary:hover {
  filter: brightness(1.1)
}

/* Info row */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  gap: 10px
}

.active-list-title {
  font-weight: 600;
  font-size: 17px
}

.filter-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer
}

.filter-btn.active {
  background: rgba(0, 0, 0, 0.05);
  font-weight: 600
}

/* Tasks area */
.tasks-area {
  flex: 1;
  overflow: auto;
  padding-right: 4px
}

.tasks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px
}

.lists li {
  font-size: 15px;
}

.add-list-btn {
  font-size: 15px;
}

.task-card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-subtle);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform .12s, box-shadow .12s;
}

.task-card.important-task {
  border-left: 4px solid var(--accent);
}

.task-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08)
}

.checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer
}

.checkbox.checked {
  background: var(--accent);
  color: white
}

.task-content {
  flex: 1;
  min-width: 0
}

.task-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
}

.completed {
  text-decoration: line-through;
  color: var(--muted)
}

.task-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
}

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

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #ef4444;
}

.important {
  color: var(--accent)
}

.overdue {
  color: #ef4444
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100
}

.modal {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity .2s ease;
}

.modal.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--card);
  padding: 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  width: 90%;
  max-width: 360px
}

.modal-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px
}

.modal-row span {
  font-size: 13px;
  color: var(--muted)
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px
}

/* Mobile list dropdown */
.mobile-list-dropdown {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
}

.mobile-list-dropdown {
  display: none;
  /* hide by default */
}


/* Hide sidebar, show dropdown on small screens */
@media (max-width: 700px) {

  .sidebar {
    display: none !important;
  }

  .mobile-list-dropdown {
    display: inline-block !important;
  }

  /* Mobile custom list container */

  @media (max-width: 700px) {
    .mobile-lists-container {
      display: flex;
      flex-direction: column;
      gap: 6px;
      max-height: 55vh;
      overflow-y: auto;
      margin-top: 8px;
    }

    .mobile-lists-container li {
      padding: 8px 10px;
      border-radius: 10px;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 15px;
      background: var(--card);
    }

    .mobile-lists-container li.active {
      background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
      border-left: 4px solid var(--accent);
      font-weight: 600;
    }

    .mobile-lists-container li .icon-btn {
      color: var(--muted);
      font-size: 16px;
    }

    .mobile-lists-container li .icon-btn:hover {
      color: var(--accent);
    }
  }



}


@media (max-width: 700px) {

  /* Make main-panel fill the viewport below header */
  .main-panel {
    min-height: calc(100vh - 64px - 20px);
    /* header height + container padding */
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  /* Make tasks area scrollable */
  .tasks-area {
    flex: 1;
    overflow-y: auto;
  }
}


/* ===== Responsive Layouts ===== */

@media (max-width:1024px) {
  .container {
    padding: 14px;
    gap: 14px;
  }
}

@media (max-width:820px) {
  .container {
    flex-direction: column;
    padding: 10px
  }

  .sidebar {
    width: 100%;
    order: 2;
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    box-shadow: none;
    border-radius: var(--radius);
    padding: 10px;
  }

  .lists {
    flex-direction: row;
    max-height: none
  }

  .lists li {
    flex: 1;
    justify-content: center;
    white-space: nowrap
  }

  .add-list-btn {
    white-space: nowrap
  }

  .main-panel {
    padding: 14px
  }

  .today-display {
    display: none
  }
}

@media (max-width:650px) {
  .quick-add {
    flex-direction: column;
    align-items: stretch
  }

  .circle-btn {
    align-self: flex-end
  }

  .header-right {
    justify-content: center
  }

  .theme-palette {
    justify-content: center
  }
}

@media (max-width:480px) {
  .app-header {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    text-align: center;
    height: auto;
    padding: 12px
  }

  .container {
    padding: 8px
  }

  .sidebar {
    display: none
  }

  .main-panel {
    padding: 12px
  }

  .filter-buttons {
    justify-content: center
  }

  .task-card {
    padding: 10px;
    gap: 8px
  }

  .btn-primary {
    width: 100%
  }

  .modal-card {
    width: 95%
  }
}

.mobile-del-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
}

.app[data-theme="dark"] .mobile-del-btn {
  color: var(--muted);
}