/* Color Palette Variables for Light and Dark themes */
:root {
  --bg-body: #8091a8;
  --bg-card: #ffffff;
  --text-main: #333333;
  --text-muted: #666666;
  --border-color: #eee;
  --kanban-col-bg: #b5bcc9;
  --kanban-card-bg: #f0ead0;
  --kanban-card-text: #3f3a2e;
}

body.dark-mode {
  --bg-body: #1e1e2e;
  --bg-card: #2a2a3c;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: #374151;
  --kanban-col-bg: #181825;
  --kanban-card-bg: #313244;
  --kanban-card-text: #cdd6f4;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  padding: 40px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.container.auth-mode {
  max-width: 500px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 2px;
}

.logo {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.app-header h1 {
  margin: 0;
  font-size: 24px;
}

/* Authentication Section Styles */
#authSection {
  max-width: 320px;
  margin: 0 auto;
}

#authSection h2 {
  text-align: center;
}

#authSection input,
.modal input,
.modal select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

#authSection button {
  width: 100%;
  padding: 8px;
  cursor: pointer;
  font-size: 14px;
}

.auth-toggle {
  text-align: center;
  font-size: 14px;
  margin-top: 10px;
}

.error {
  color: #b91c1c;
  font-size: 14px;
  text-align: center;
  min-height: 18px;
}

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

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

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

/* Theme Toggle Button */
.theme-btn {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.theme-btn:hover {
  background-color: var(--border-color);
}

/* Visual Progress Bar */
.progress-container {
  width: 100%;
  background-color: var(--border-color);
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: #16a34a;
  transition: width 0.3s ease;
}

.add-task {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.add-task input[type="text"] {
  flex: 2;
  min-width: 180px;
  padding: 8px;
}

.add-task input,
.add-task select {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.add-task input[type="date"],
.add-task select {
  padding: 8px;
  border-radius: 6px;
  font-size: 14px;
}

/* 1. Apply the warm yellow background ONLY to Table View */
#taskTable,
table {
  background-color: #fefce8; /* Soft warm yellow */
  border-radius: 12px;
  border: 1px solid #fde047; /* Darker yellow accent border */
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

/* Ensure table cells contrast cleanly against the warm yellow background */
#taskTable th {
  background-color: #fef08a; /* Slightly deeper yellow for header */
  border-bottom: 2px solid #eab308;
  color: #1e293b;
}

#taskTable td {
  border-bottom: 1px solid #fef08a;
}

/* Reset Board View back to normal clean background */
#boardView,
.board-view {
  background-color: transparent;
  border: none;
  padding: 0;
}

/* 2. Darker, crisp borders for all Task Creation inputs */
.add-task input,
.add-task select {
  border: 1.5px solid #64748b; /* Stronger gray border for high contrast */
  background-color: #ffffff;
  color: #0f172a;
}

.add-task input:focus,
.add-task select:focus {
  border-color: #2563eb; /* Active blue border when clicking into input */
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Dark Mode adjustments (keeps text readable if dark mode is toggled) */
body.dark-mode #taskTable,
body.dark-mode table {
  background-color: #2c2c2b;
  border-color: #454124;
}

body.dark-mode #taskTable th {
  background-color: #3f3b25;
  color: #f8fafc;
}

body.dark-mode .add-task input,
body.dark-mode .add-task select {
  border: 1.5px solid #94a3b8;
  background-color: #1e293b;
  color: #f8fafc;
}

/* Table and Interactive Header Sorting */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  color: #2563eb;
}

.sort-icon {
  font-size: 11px;
  margin-left: 4px;
}

button {
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

button:hover {
  background-color: #1d4ed8;
}

button.secondary-btn {
  background-color: #6b7280;
}

button.secondary-btn:hover {
  background-color: #4b5563;
}

.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 14px;
}

.stats-bar span {
  background: var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  background: var(--border-color);
  color: var(--text-main);
}

.filter-btn.active {
  background: #15803d;
  color: #fff;
}

.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

#toastBar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  color: #fff;
  z-index: 1000;
  display: none;
}

#toastBar.show {
  display: block;
}

#toastBar.error {
  background: #dc2626;
}

#toastBar.success {
  background: #16a34a;
}

.view-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.view-btn {
  background: var(--border-color);
  color: var(--text-main);
}

.view-btn.active {
  background: #2563eb;
  color: #fff;
}

/* Priority Badges & Domain Tags */
.badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  display: inline-block;
}

.badge-low {
  background: #e0f2fe;
  color: #0369a1;
}
.badge-medium {
  background: #fef3c7;
  color: #b45309;
}
.badge-high {
  background: #fee2e2;
  color: #b91c1c;
}

.tag {
  background: var(--border-color);
  color: var(--text-main);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid var(--border-color);
  font-weight: bold;
}

/* Kanban View Layout */
.board-view {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

#searchInput {
  margin-bottom: 24px;
}

.board-column {
  flex: 1;
  background: var(--kanban-col-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  margin-right: 16px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.board-column:last-child {
  margin-right: 0;
}

.board-column h3 {
  font-size: 14px;
  text-transform: uppercase;
  margin: 4px 0 10px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.column-count {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 12px;
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  min-height: 100px;
}

.task-card {
  background: var(--kanban-card-bg);
  color: var(--kanban-card-text);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: grab;
}

/* Task Overdue & Warning Indicators */
.task-card.overdue,
tr.overdue {
  border-left: 5px solid #dc2626 !important;
}

.task-card.due-soon,
tr.due-soon {
  border-left: 5px solid #f59e0b !important;
}

.task-card .card-name {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
}

.task-card .card-due {
  font-size: 12px;
  margin-bottom: 8px;
}

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

/* Action Icon Buttons */
.icon-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 5px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.edit-icon-btn {
  color: #2563eb;
}
.delete-icon-btn {
  color: #dc2626;
}
.restore-icon-btn {
  color: #16a34a;
}

/* Edit Task Modal Dialog */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 24px;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-content label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin: 8px 0 4px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* Custom Category Badges */
.tag-aws {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fdba74;
}

.tag-cicd {
  background: #fef9c3;
  color: #a16207;
  border-color: #fde047;
}

.tag-docker {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

.tag-terraform {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}

.tag-backend {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.tag-frontend {
  background: #fce7f3;
  color: #be185d;
  border-color: #f9a8d4;
}

.tag-general {
  background: var(--border-color);
  color: var(--text-main);
}
