/*
════════════════════════════════════════
  Project:    To-Do Dashboard App
  Repo:       html-css-js/To-Do-Dashboard-App
  Developer:  Mirza Hadi
  Role:       Full-Stack WordPress Developer
              & Technical Problem Solver
  Website:    hadi-mirza.com
  LinkedIn:   linkedin.com/in/hadibaig
  GitHub:     github.com/Hadibaig
  Newsletter: DCXherald — 4,000+ subscribers
════════════════════════════════════════
*/

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

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f6f7fb;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 60px;
  background: #1f2937;
  border-bottom: 1px solid #374151;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.4rem;
  color: #60a5fa;
}

/* Nav */
#mainNav {
  display: flex;
  align-items: center;
  gap: 8px;
}

#mainNav button {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  background: transparent;
  color: #d1d5db;
  transition: background 0.15s, color 0.15s;
}

#mainNav button:hover {
  background: #374151;
  color: #fff;
}

#mainNav .primary {
  background: #3b82f6;
  color: white;
}

#mainNav .primary:hover {
  background: #2563eb;
}

/* Hamburger (hidden on desktop) */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  margin-left: auto;
}

.hamburger:hover {
  background: #374151;
}

/* ============================================================
   MOBILE TASK BAR (hidden on desktop)
   ============================================================ */
.mobile-task-bar {
  display: none;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-task-bar::-webkit-scrollbar {
  height: 3px;
}

.mobile-task-bar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

#mobileTaskTabs {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.mobile-task-tab {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  min-width: 110px;
  max-width: 140px;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.mobile-task-tab:active {
  transform: scale(0.97);
}

.mobile-task-tab.active-tab {
  border-color: #3b82f6;
}

.mobile-task-tab b {
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f2937;
}

.mobile-task-tab small {
  font-size: 0.72rem;
  color: #6b7280;
  margin-top: 2px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: 260px;
  background: white;
  padding: 16px 12px;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar h3 {
  margin: 0 0 14px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-limit {
  font-weight: 400;
  color: #9ca3af;
  font-size: 0.8rem;
}

/* Task list */
#taskList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
}

.task:hover {
  border-color: #93c5fd;
  transform: translateX(2px);
}

.task b {
  font-size: 0.88rem;
  color: #1f2937;
}

.task small {
  color: #6b7280;
  font-size: 0.77rem;
}

/* ============================================================
   MAIN
   ============================================================ */
.main {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
}

/* Welcome card */
.welcome-card {
  max-width: 480px;
  padding: 32px;
  background: white;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.welcome-icon {
  font-size: 2.2rem;
  color: #3b82f6;
  display: block;
  margin-bottom: 12px;
}

.welcome-card h2 {
  margin: 0 0 10px 0;
  font-size: 1.3rem;
  color: #1f2937;
}

.welcome-card p {
  margin: 0;
  color: #6b7280;
  line-height: 1.6;
}

/* Task detail */
#taskDetail h2 {
  margin: 0 0 6px 0;
  font-size: 1.4rem;
  color: #1f2937;
}

.detail-date {
  color: #6b7280;
  font-size: 0.88rem;
  margin: 0 0 14px 0;
}

.colorBox {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  margin-bottom: 14px;
  border: 1px solid rgba(0,0,0,0.08);
}

#detailDesc {
  color: #374151;
  line-height: 1.6;
  max-width: 560px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-edit {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  background: #1f2937;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
}

.btn-edit:hover {
  background: #374151;
}

.danger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
}

.danger:hover {
  background: #dc2626;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 16px;
}

.modalBox {
  background: white;
  padding: 24px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  animation: pop 0.15s ease-out;
}

@keyframes pop {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #1f2937;
}

.modal-close-x {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.modal-close-x:hover {
  background: #f3f4f6;
  color: #374151;
}

.modalBox input,
.modalBox textarea {
  width: 100%;
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  outline: none;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.modalBox input:focus,
.modalBox textarea:focus {
  border-color: #3b82f6;
}

.modalBox textarea {
  height: 80px;
  resize: none;
}

.color-section {
  margin: 12px 0;
}

.color-label {
  font-size: 0.8rem;
  color: #6b7280;
  display: block;
  margin-bottom: 6px;
}

.colors {
  display: flex;
  gap: 8px;
}

.c {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s, border-color 0.1s;
}

.c:hover {
  transform: scale(1.2);
  border-color: #374151;
}

.yellow  { background: #fff9c4; }
.green   { background: #d1f7c4; }
.blue    { background: #cce5ff; }
.pink    { background: #ffd6e7; }
.purple  { background: #e6d6ff; }

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

#saveTaskBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: #1f2937;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s;
}

#saveTaskBtn:hover {
  background: #374151;
}

.btn-cancel {
  width: 100%;
  padding: 9px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.btn-cancel:hover {
  background: #e5e7eb;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: #1f2937;
  color: #9ca3af;
  padding: 16px 24px;
  margin-top: auto;
  border-top: 1px solid #374151;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.footer-brand i {
  color: #60a5fa;
  font-size: 1.2rem;
}

.footer-info {
  font-size: 0.85rem;
  color: #9ca3af;
}

.footer-info strong {
  color: #e5e7eb;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #60a5fa;
}

