/* BASE RESET */
* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6f8;
  --text: #000;
  --card: #fff;
}

.dark {
  --bg: #111827;
  --text: #fff;
  --card: #1f2937;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 20px;
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
}

.hidden {
  display: none;
}

/* LOGIN */
.login-box {
  max-width: 320px;
  margin: 120px auto;
  text-align: center;
  background: var(--card);
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-box input {
  width: 100%;
  margin-bottom: 12px;
}

/* HEADER */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  padding: 16px 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  animation: slideDown 0.6s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-actions {
  display: flex;
  gap: 10px;
}

header button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

header button:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* FORM & FILTERS */
.task-form,
.filters {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

input,
select {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

input:focus,
select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* BUTTONS */
button {
  background: #6366f1;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s;
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: scale(0.96);
}

/* DASHBOARD */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.card {
  background: var(--card);
  padding: 18px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-5px);
}

/* PROGRESS */
.progress-container {
  height: 10px;
  background: #ccc;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 20px;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: #22c55e;
  transition: width 0.4s ease;
}

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

tr:hover {
  background: rgba(99, 102, 241, 0.08);
}

/* PRIORITY */
.priority {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.priority.High {
  background: #ef4444;
  color: white;
}

.priority.Medium {
  background: #f59e0b;
}

.priority.Low {
  background: #22c55e;
}

/* OVERDUE */
.overdue {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* DARK MODE FIXES */
.dark input,
.dark select,
.dark th,
.dark td {
  border-color: #374151;
}

/* MOBILE */
@media (max-width: 768px) {
  header,
  .task-form,
  .filters {
    flex-direction: column;
    text-align: center;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  td {
    display: flex;
    justify-content: space-between;
    border: none;
  }

  td::before {
    content: attr(data-label);
    font-weight: bold;
  }
}
