body{
  margin: 0;
  font-family: 'Arial', sans-serif;
}

.hero{
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.background{
  position: fixed;
  inset: 0;

  background-image: url("images/background_img.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  filter: contrast(1.15) saturate(1.1);
  z-index: -2;
}

.background::after{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.main_heading{
  color: #e50914;
  font-size: 55px;
  letter-spacing: 4px;
  text-transform: uppercase;

  text-shadow:
    0 0 5px #ff2a2a,
    0 0 10px #ff2a2a,
    0 0 20px #e50914,
    0 0 40px #e50914;

  margin: 20px;
  margin-bottom: 5px;
}

.small_heading{
  margin: 0;
  font-size: 25px;
  color: #9ca3af;
  letter-spacing: 2px;
}

.searchbar_outer{
  display: flex;
  align-items: center;
  gap: 18px;

  padding: 18px 22px;
  border-radius: 14px;

  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(6px);
}

.searchbar{
  flex: 1;
  height: 52px;
  padding: 0 18px;

  border-radius: 999px;
  border: 2px solid rgba(229, 9, 20, 0.85);
  background: rgba(0,0,0,0.25);

  color: #d1d5db;
  font-size: 16px;
  outline: none;
}

.searchbar:focus{
  border-color: rgba(255, 80, 80, 0.95);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25);
}

.add_button{
  height: 52px;
  padding: 0 18px;

  display: flex;
  align-items: center;
  gap: 10px;

  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.25);

  color: #d1d5db;
  font-size: 15px;
  cursor: pointer;

  transition: background 120ms ease, transform 120ms ease;
}

.add_button:hover{
  background: rgba(255,255,255,0.08);
}

.add_button:active{
  transform: scale(0.98);
}

.plus_sign{
  width: 16px;
  height: 16px;
}

.controls_outer{
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.control_block{
  flex: 1;
}

.control_label{
  margin: 0 0 10px 2px;
  font-size: 18px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
}

.pill_group{
  display: flex;
  gap: 14px;
}

.pill{
  flex: 1;
  height: 56px;

  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);

  font-size: 18px;
  color: #d1d5db;
  cursor: pointer;

  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.pill:hover{
  background: rgba(255,255,255,0.08);
}

.pill:active{
  transform: scale(0.98);
}

.category_select{
  width: 100%;
  height: 56px;

  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);

  padding: 0 16px;
  font-size: 18px;
  color: #d1d5db;
  outline: none;

  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.category_select:focus{
  border-color: rgba(120,160,255,0.7);
  box-shadow: 0 0 0 3px rgba(120,160,255,0.18);
}

.category_select option{
  background: #0b0f16;
  color: #d1d5db;
}

.filter_outer{
  margin-top: 18px;

  display: flex;
  align-items: center;
  gap: 18px;

  padding: 18px 22px;
  border-radius: 14px;

  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(6px);
}

.filter_search{
  flex: 1;
  height: 56px;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.25);
}

.search_icon{
  opacity: 0.75;
  font-size: 18px;
  user-select: none;
}

.filter_input{
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;

  color: #d1d5db;
  font-size: 18px;
}

.filter_input::placeholder{
  color: rgba(209, 213, 219, 0.6);
}

.filter_search:focus-within{
  border-color: rgba(120,160,255,0.7);
  box-shadow: 0 0 0 3px rgba(120,160,255,0.18);
}

.filter_actions{
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.filter_tabs{
  display: flex;
  gap: 12px;
}

.tab{
  height: 56px;
  padding: 0 22px;

  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);

  color: #d1d5db;
  font-size: 18px;
  cursor: pointer;

  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.tab:hover{
  background: rgba(255,255,255,0.08);
}

.tab:active{
  transform: scale(0.98);
}

.tab.active{
  border-color: rgba(229, 9, 20, 0.75);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.18);
  background: rgba(229, 9, 20, 0.12);
  color: #ffd6d6;
}

.clear_completed{
  height: 56px;
  padding: 0 18px;

  border-radius: 999px;
  border: 1px solid rgba(229, 9, 20, 0.55);
  background: rgba(0,0,0,0.18);

  color: #ff6b6b;
  font-size: 18px;
  cursor: pointer;

  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.clear_completed:hover{
  background: rgba(229, 9, 20, 0.08);
  border-color: rgba(229, 9, 20, 0.75);
}

.clear_completed:active{
  transform: scale(0.98);
}

@media (max-width: 900px){
  .filter_outer{
    flex-direction: column;
    align-items: stretch;
  }

  .filter_actions{
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }

  .filter_tabs{
    flex: 1;
  }

  .tab{
    flex: 1;
    text-align: center;
  }

  .clear_completed{
    width: 100%;
  }
}

@media (max-width: 760px){
  .searchbar_outer{
    flex-direction: column;
    align-items: stretch;
  }

  .add_button{
    width: 100%;
    justify-content: center;
  }

  .controls_outer{
    flex-direction: column;
  }
}

.layout{
  width: min(1280px, 92vw);
  margin: 30px auto 0 auto;

  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: start;
}

.stats_panel{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat_card{
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 18px 18px;
  border-radius: 16px;

  background: transparent;
  backdrop-filter: none;

  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}

.stat_icon{
  width: 54px;
  height: 54px;
  border-radius: 16px;

  display: grid;
  place-items: center;

  font-size: 20px;
  color: #d1d5db;

  background: transparent;
  backdrop-filter: none;

  border: 1px solid rgba(255,255,255,0.12);
}

.icon_total{
  box-shadow: 0 0 0 3px rgba(120,160,255,0.12);
}

.icon_active{
  box-shadow: 0 0 0 3px rgba(255, 200, 80, 0.10);
}

.icon_done{
  box-shadow: 0 0 0 3px rgba(80, 255, 160, 0.10);
}

.stat_text{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat_label{
  margin: 0;
  font-size: 16px;
  color: rgba(255,255,255,0.75);
}

.stat_value{
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #e5e7eb;
}

.stat_sub{
  font-weight: 500;
  font-size: 16px;
  color: rgba(209, 213, 219, 0.7);
  margin-left: 6px;
}

.task_ui{
  width: 100%;
  margin: 0;
}

.tasks_box{
  margin-top: 18px;
  min-height: 360px;

  padding: 18px 22px;
  border-radius: 16px;

  background: transparent;
  backdrop-filter: none;

  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
  position: relative;
  overflow: hidden;
}

.tasks_box::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(229, 9, 20, 0.18);
}

.tasks_empty{
  height: 100%;
  min-height: 320px;

  display: grid;
  place-items: center;
  text-align: center;

  color: rgba(209, 213, 219, 0.85);
}

.empty_icon{
  width: 74px;
  height: 74px;
  border-radius: 999px;

  display: grid;
  place-items: center;

  background: transparent;
  backdrop-filter: none;

  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.12);
  margin-bottom: 14px;

  font-size: 22px;
  color: rgba(255, 214, 214, 0.95);
}

.empty_title{
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #e5e7eb;
}

.empty_sub{
  margin: 6px 0 0 0;
  font-size: 16px;
  color: rgba(209, 213, 219, 0.65);
}

@media (max-width: 980px){
  .layout{
    grid-template-columns: 1fr;
  }

  .stats_panel{
    flex-direction: row;
    flex-wrap: wrap;
  }

  .stat_card{
    flex: 1;
    min-width: 240px;
  }
}

.pill.active {
  border: 1px solid #e50914;      
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.35);
  background: rgba(229, 9, 20, 0.12);
  color: #ffd6d6;
}

/* ---------- TASK CARD + FIX COLLISION ---------- */

.task_row{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.22);
  margin-bottom: 12px;
  width: 100%;
}

.task_check{
  flex-shrink: 0;
}

.task_textwrap{
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0; /* important */
}

.task_title{
  color: #e5e7eb;
  font-size: 16px;

  /* important: prevent pushing buttons */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task_meta{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge{
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.18);
  color: rgba(229,231,235,0.9);
}

.badge_category{
  border-color: rgba(120,160,255,0.35);
}

.badge_priority{
  font-weight: 600;
}

.p_low{
  border-color: rgba(80,255,160,0.45);
  box-shadow: 0 0 0 3px rgba(80,255,160,0.10);
}

.p_medium{
  border-color: rgba(255,200,80,0.45);
  box-shadow: 0 0 0 3px rgba(255,200,80,0.10);
}

.p_high{
  border-color: rgba(229,9,20,0.55);
  box-shadow: 0 0 0 3px rgba(229,9,20,0.12);
}

/* Buttons: do not shrink so they don't overlap text */
.task_edit,
.task_delete,
.task_cancel{
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}

.task_delete{
  border: 1px solid rgba(229, 9, 20, 0.55);
  background: rgba(0,0,0,0.18);
  color: #ff6b6b;
}

.task_delete:hover{
  background: rgba(229, 9, 20, 0.10);
}

.task_edit{
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.18);
  color: #d1d5db;
}

.task_edit:hover{
  background: rgba(255,255,255,0.08);
}

.task_edit:active,
.task_delete:active,
.task_cancel:active{
  transform: scale(0.98);
}

/* Save mode look */
.task_edit.save_mode{
  border-color: rgba(229, 9, 20, 0.55);
  color: #ffd6d6;
  background: rgba(229, 9, 20, 0.10);
}

.task_edit.save_mode:hover{
  background: rgba(229, 9, 20, 0.16);
}

/* Cancel button */
.task_cancel{
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.18);
  color: rgba(209,213,219,0.95);
}

.task_cancel:hover{
  background: rgba(255,255,255,0.08);
}

/* Edit input inside card */
.task_edit_input{
  width: 100%;
  height: 42px;
  padding: 0 14px;
  min-width: 0;

  border-radius: 999px;
  border: 1px solid rgba(120,160,255,0.35);
  background: rgba(0,0,0,0.22);

  color: #e5e7eb;
  font-size: 16px;
  outline: none;

  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.task_edit_input:focus{
  border-color: rgba(255, 80, 80, 0.9);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.22);
  background: rgba(0,0,0,0.28);
}

.task_edit_input::placeholder{
  color: rgba(209, 213, 219, 0.6);
}

/* Mobile: let buttons wrap to next line if needed */
@media (max-width: 700px){
  .task_row{
    flex-wrap: wrap;
  }
  .task_textwrap{
    width: 100%;
  }
}
