/* ========================================================
   TaskEasy - Skin Tone Grid Theme & Interactive Styling
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Warm Skin & Sand Palette */
  --bg-skin: #f7efe7;
  --bg-skin-card: #ffffff;
  --bg-skin-subtle: #fbf6f0;
  --grid-line: rgba(175, 140, 115, 0.18);
  --border-warm: rgba(170, 135, 110, 0.25);
  --border-focus: #c85a32;

  /* Typography */
  --text-primary: #231f1c;
  --text-secondary: #6e655f;
  --text-muted: #9c9189;

  /* Vibrant Accent */
  --accent-terracotta: #d95d39;
  --accent-terracotta-hover: #c24d2b;
  --accent-warm-dark: #2a2420;

  /* Status & Priority Tokens */
  --status-todo-bg: #f3ece4;
  --status-todo-text: #6b5b50;
  --status-progress-bg: #e0f2fe;
  --status-progress-text: #0369a1;
  --status-done-bg: #dcfce7;
  --status-done-text: #15803d;

  --priority-high: #e11d48;
  --priority-high-bg: #ffe4e6;
  --priority-medium: #d97706;
  --priority-medium-bg: #fef3c7;
  --priority-low: #059669;
  --priority-low-bg: #d1fae5;

  /* Shadows */
  --shadow-sm: 0 2px 8px -2px rgba(80, 50, 30, 0.06);
  --shadow-md:
    0 8px 24px -4px rgba(80, 50, 30, 0.08),
    0 2px 6px -1px rgba(80, 50, 30, 0.04);
  --shadow-lg:
    0 16px 36px -6px rgba(80, 50, 30, 0.12),
    0 4px 12px -2px rgba(80, 50, 30, 0.06);
  --shadow-hover: 0 14px 30px -4px rgba(120, 70, 40, 0.14);
}

/* Base Body with Tactile Grid Paper Pattern */
body {
  font-family:
    'Plus Jakarta Sans',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-skin);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px;
  background-attachment: fixed;
  min-height: 100vh;
  margin: 0;
  padding-bottom: 3rem;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Header */
.app-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-warm);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(70, 45, 25, 0.04);
  transition: all 0.3s ease;
}

.brand-badge {
  background: linear-gradient(135deg, var(--accent-terracotta), #ea734c);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(217, 93, 57, 0.3);
}

.brand-title {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

/* Hero Banner & Live Counter Stats */
.hero-card {
  background: #ffffff;
  border: 1px solid var(--border-warm);
  border-radius: 20px;
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.75rem;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 160px;
  height: 160px;
  background: radial-gradient(
    circle,
    rgba(217, 93, 57, 0.12) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-title {
  font-weight: 800;
  letter-spacing: -0.7px;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 580px;
  margin: 0 auto 1.25rem;
}

/* Stats Counter Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

.stat-box {
  background: var(--bg-skin-subtle);
  border: 1px solid var(--border-warm);
  border-radius: 14px;
  padding: 0.75rem;
  text-align: center;
  transition: all 0.25s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: var(--accent-terracotta);
}

.stat-number {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Modern Pill Navigation Tabs */
.nav-pills-custom {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  padding: 0.35rem;
  border-radius: 16px;
  border: 1px solid var(--border-warm);
  display: inline-flex;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.nav-pills-custom .nav-item {
  flex: 1;
}

.nav-pills-custom .nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  padding: 0.65rem 1.25rem;
  text-align: center;
  border: none;
  background: transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.nav-pills-custom .nav-link:hover {
  color: var(--text-primary);
  background: rgba(217, 93, 57, 0.06);
}

.nav-pills-custom .nav-link.active {
  background: var(--accent-warm-dark);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(35, 31, 28, 0.2);
}

/* Main Cards */
.main-card {
  background: var(--bg-skin-card);
  border: 1px solid var(--border-warm);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

/* Form Controls with Tactile Focus */
.form-control,
.form-select {
  border: 1.5px solid var(--border-warm);
  background-color: #ffffff;
  color: var(--text-primary);
  border-radius: 12px;
  padding: 0.7rem 0.95rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-terracotta);
  box-shadow: 0 0 0 4px rgba(217, 93, 57, 0.15);
  background-color: #fff;
  color: var(--text-primary);
}

.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

/* Search Bar Wrapper */
.search-wrapper {
  position: relative;
}

.search-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.search-wrapper input {
  padding-left: 2.75rem;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-terracotta), #ea734c);
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.75rem 1.4rem;
  letter-spacing: -0.2px;
  box-shadow: 0 4px 14px rgba(217, 93, 57, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--accent-terracotta-hover), #d95d39);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(217, 93, 57, 0.4);
  color: #fff;
}

.btn-primary:active {
  transform: translateY(0);
}

/* Task Item Card - Interactive & Animated */
@keyframes taskEntrance {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.list-group {
  gap: 0.85rem;
}

.task-item {
  background: #ffffff;
  border: 1px solid var(--border-warm);
  border-left: 6px solid var(--text-muted);
  border-radius: 16px !important;
  padding: 1.15rem 1.25rem;
  margin-bottom: 0 !important;
  box-shadow: var(--shadow-sm);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  animation: taskEntrance 0.35s ease-out forwards;
  position: relative;
}

.task-item:hover {
  background: #ffffff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(170, 135, 110, 0.4);
}

/* Priority Left Accent */
.task-item.priority-low {
  border-left-color: var(--priority-low);
}

.task-item.priority-medium {
  border-left-color: var(--priority-medium);
}

.task-item.priority-high {
  border-left-color: var(--priority-high);
}

.task-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.3px;
}

.task-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

/* Badges */
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  text-transform: capitalize;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge.status-todo {
  background-color: var(--status-todo-bg);
  color: var(--status-todo-text);
  border: 1px solid rgba(107, 91, 80, 0.2);
}

.badge.status-in-progress {
  background-color: var(--status-progress-bg);
  color: var(--status-progress-text);
  border: 1px solid rgba(3, 105, 161, 0.2);
}

.badge.status-done {
  background-color: var(--status-done-bg);
  color: var(--status-done-text);
  border: 1px solid rgba(21, 128, 61, 0.2);
}

.badge.priority-low {
  background-color: var(--priority-low-bg);
  color: var(--priority-low);
}

.badge.priority-medium {
  background-color: var(--priority-medium-bg);
  color: var(--priority-medium);
}

.badge.priority-high {
  background-color: var(--priority-high-bg);
  color: var(--priority-high);
}

/* Status Pulse Animation for In-Progress */
@keyframes statusPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(3, 105, 161, 0.4);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(3, 105, 161, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(3, 105, 161, 0);
  }
}

.badge.status-in-progress::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-progress-text);
  display: inline-block;
  animation: statusPulse 1.8s infinite;
}

/* Task Action Buttons (Mobile-friendly, no hover lock) */
.task-actions {
  display: flex;
  gap: 0.4rem;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.btn-action {
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-action-edit {
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.btn-action-edit:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
  transform: translateY(-1px);
}

.btn-action-delete {
  color: #be123c;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.btn-action-delete:hover {
  background: #e11d48;
  color: #fff;
  border-color: #e11d48;
  transform: translateY(-1px);
}

/* Empty State Styling */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-skin-subtle);
  border: 2px dashed var(--border-warm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Modal Customization */
.modal-content {
  border-radius: 20px;
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--border-warm);
  background: var(--bg-skin-subtle);
  padding: 1.25rem 1.5rem;
}

.modal-title {
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border-warm);
  padding: 1rem 1.5rem;
  background: var(--bg-skin-subtle);
}

/* Toast Notification */
.toast {
  border-radius: 14px;
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-lg);
}

.toast-header {
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  background: var(--bg-skin-subtle);
  font-weight: 700;
}

/* Responsive tweaks */
@media (max-width: 576px) {
  .hero-card {
    padding: 1.25rem 1rem;
  }
  .task-item {
    padding: 1rem;
  }
  .task-actions {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: flex-end;
  }
  .task-footer-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }
}
