/* ==============================
   THEME VARIABLES
============================== */
:root {
  --bg-color: #0d0d0d;
  --text-color: #0ff;
  --input-bg: #111;
  --input-border: #0ff;
  --btn-color: #f66;
  --card-bg: #1a1a1ae1;
  --card-border: #0ff;
  --star-color: #58a6ff; 
  --modal-bg: rgba(0, 0, 0, 0.8);
  --modal-content-bg: #222;
  --modal-border: #0ff;
  --border-color: var(--card-border);
  --accent: var(--card-border);
}

body.light-mode {
  --bg-color: #f0f0f0;
  --text-color: #111;
  --input-bg: #fff;
  --input-border: #333;
  --btn-color: #a00;
  --card-bg: #f8f8f8a2;
  --card-border: #ccc;
  --star-color: #000; 
  --modal-bg: rgba(0, 0, 0, 0.8);
  --modal-content-bg: #fff;
  --modal-border: #333;
  --border-color: var(--card-border);
  --accent: var(--card-border);
}

/* ==============================
   GLOBAL STYLES
============================== */
body {
  font-family: sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.3s, color 0.3s;
}

h1 {
  margin-bottom: 1rem;
  text-align: center;
}

ul {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
  width: 100%;
}

li {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  margin: 0.5rem 0;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
}

li.done span {
  text-decoration: line-through;
  color: #888;
}

/* ==============================
   BUTTONS
============================== */
button {
  background: none;
  border: none;
  color: var(--btn-color);
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  color: red;
}

/* ==============================
   THEME TOGGLE
============================== */
#toggle-theme {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch .slider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  background: #ccc;
  border-radius: 34px;
  transition: background 0.3s;
  border: 1px solid #eee;
}

.theme-switch .slider:before {
  content: "🌞";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 24px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-switch input:checked + .slider:before {
  content: "🌙";
  background: transparent;
  transform: translateX(22px);
}

.theme-switch input:checked + .slider {
  background: #006dd3;
}

/* ==============================
   CANVAS BACKGROUND
============================== */
#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* ==============================
   LAYOUT
============================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar h1 {
  margin: 0 auto;
}

/* ==============================
   TOOLBAR
============================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.toolbar.top {
  flex-wrap: wrap;
}

.sort-and-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

#todo-input {
  width: 100%;
  padding: .5rem;
  background: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--input-border);
  border-radius: 5px;
}

/* ==============================
   SEARCH
============================== */
.search-wrapper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.search-icon {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-color);
}

#search-input {
  display: none;
  flex: 1 1 200px;
  min-width: 150px;
  padding: 0.4rem;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
}

#search-input.active {
  display: block;
}

/* ==============================
   PROGRESS BAR
============================== */
#progress-inline {
  flex: 1 1 150px;
  height: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: #00ffc3;
  transition: width 0.3s ease;
}

/* ==============================
   CARDS
============================== */
.card-container {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--card-border);
  padding: 1.5rem;
  width: 90%;
  max-width: 500px;
}

.card-container h2 {
  margin-top: 0;
}

/* ==============================
   MODAL
============================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-color: var(--modal-bg);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: var(--modal-content-bg);
  padding: 20px;
  border: 1px solid var(--modal-border);
  border-radius: 8px;
  width: 80%;
  max-width: 400px;
}

/* ==============================
   RESPONSIVE
============================== */
@media (max-width: 700px) {
  .toolbar.top,
  .sort-and-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar.top > *,
  .sort-and-buttons > * {
    width: 100%;
  }
}
/* Unified card around To‑Do + Done */
#todo-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 900px;      /* feels roomy on desktop */
  margin: 0 auto;
  padding: 1.25rem;      /* keep it comfy */
}

/* Thin separator between lists */
.divider {
  border: none;
  border-top: 1px solid var(--card-border);
  opacity: .6;
  margin: .5rem 0 0.75rem;
}

/* Make sure the back link is clickable and spaced */
.back-button-wrapper {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 1.5rem 0 2.5rem;
}
.back-button {
  display: inline-block;     /* ensure click area */
  pointer-events: auto;
}
/* Back to Portal button */
.back-button-wrapper{
  text-align:center;
  margin: 1.5rem 0 3rem;
  position: relative;
  z-index: 2;            /* keep it clickable above the card */
}

.back-button{
  display:inline-block;
  padding:.6rem 1.2rem;
  font-size:1rem;
  font-weight:600;
  border-radius:8px;
  background:#00ffdd;
  color:#000 !important; /* beat link color */
  text-decoration:none;
  box-shadow:0 0 10px rgba(0,255,221,.7);
  transition: background .25s, box-shadow .25s, transform .08s;
  border:1px solid rgba(0,255,221,.6);
}

.back-button:hover{
  background:#00fff2;
  box-shadow:0 0 20px rgba(0,255,242,1);
}

.back-button:active{
  transform: translateY(1px);
}

/* optional: nicer contrast in light mode */
body.light-mode .back-button{
  color:#000 !important;
  box-shadow:0 0 8px rgba(0,0,0,.08);
}
/* Restore pill styles */
.pill {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: .75rem;
  opacity: .9;
  background: transparent;
  line-height: 1.4;
  white-space: nowrap;
}

.pill.overdue {
  border-color: #ff5a5a;
  color: #ff5a5a;
}

/* Wiggle animation when reordering */
.dragging-active #todo-list li {
  animation: wiggle 0.6s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% {
    transform: rotate(-0.5deg);
  }
  50% {
    transform: rotate(0.5deg);
  }
}
.mini-btn {
  margin-left:.4rem; padding:.2rem .5rem; border-radius:.5rem;
  border:1px solid var(--border,#2c2c2c); background:transparent; color:inherit;
  cursor:pointer; font-size:.85rem;
}
.search-wrapper {
  display: flex;
  align-items: center;
  gap: .4rem;
}
/* Make the background canvas ignore clicks */
#stars {
  pointer-events: none;
  position: fixed;   /* or absolute */
  inset: 0;
  z-index: -1;       /* push behind UI */
}
.todo-wrapper {
  display: flex;
  flex-direction: column; /* mobile default: stacked */
  gap: 20px;
}

/* go side-by-side on big screens */
@media (min-width: 1100px) {
  .todo-wrapper {
    flex-direction: row;
    align-items: flex-start; /* keep top aligned */
  }
  
  .todo-main, .todo-done {
    flex: 1; /* equal width columns */
  }
}
/* Default: single column (unchanged) */
.card-container {
  display: block;
}

/* Default: Mobile - single column */
.card-container {
  display: block;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* Tablet: Still single column but wider */
@media (min-width: 768px) {
  .card-container {
    max-width: 600px;
  }
}

/* Large tablet/small desktop: Start considering two columns */
@media (min-width: 1024px) {
  .card-container {
    max-width: 800px;
  }
}

/* Desktop: Two column layout */
@media (min-width: 1200px) {
  .card-container {
    display: grid;
    grid-template-columns: 1.4fr 1.1fr;  /* Better ratio */
    gap: 40px;
    align-items: start;
    max-width: 1400px;                    /* Much wider max */
    width: 90%;                           /* Use more screen space */
    margin: 0 auto;
  }

  /* Main column */
  .toolbar,
  #progress-label, 
  #todo-input,
  .toolbar.below-enter,
  .repeat-row,
  .controls,
  #todo-list {
    grid-column: 1;
  }

  /* Done column */
  .card-container h2,
  #done-list {
    grid-column: 2;
  }
  
  .divider { 
    display: none; 
  }

  /* Optimize done section */
  #done-list {
    max-height: 75vh;
    overflow-y: auto;
    font-size: 0.9rem;
  }
}

/* Very wide screens: Even more space */
@media (min-width: 1600px) {
  .card-container {
    grid-template-columns: 1.6fr 1fr;    /* More space for main tasks */
    gap: 50px;
    max-width: 1600px;
  }
}

/* Clickable header */
.card-container h2 {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Arrow icon rotation */
.card-container h2::after {
  content: "▼";
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}
.card-container h2.collapsed::after {
  transform: rotate(-90deg);
}

/* Collapsed state hides the list */
#done-list.collapsed {
  display: none;
}
.sort-and-buttons {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.spacer { flex: 1; }            /* sends progress to right */
#progress-inline { min-width: 220px;  /* tweak as you like */
}

/* High priority - Red/Orange */
.pill.priority-high {
  border-color: #ff4444;
  color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

/* Medium priority - Yellow/Amber */
.pill.priority-medium {
  border-color: #ffaa00;
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.1);
}

/* Low priority - Green */
.pill.priority-low {
  border-color: #44dd44;
  color: #44dd44;
  background: rgba(68, 221, 68, 0.1);
}

/* Light mode adjustments */
body.light-mode .pill.priority-high {
  border-color: #cc0000;
  color: #cc0000;
  background: rgba(204, 0, 0, 0.1);
}

body.light-mode .pill.priority-medium {
  border-color: #cc8800;
  color: #cc8800;
  background: rgba(204, 136, 0, 0.1);
}

body.light-mode .pill.priority-low {
  border-color: #008800;
  color: #008800;
  background: rgba(0, 136, 0, 0.1);
}
/* Fix task text alignment */
li {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  margin: 0.5rem 0;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  text-align: left; /* Force left alignment */
}

/* Ensure task content is properly structured */
li .todo-text {
  flex: 1;
  text-align: left;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

/* Task meta information */
li .todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-left: 0.5rem;
  align-items: center;
}

/* Button container on the right */
li > div:last-child {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-shrink: 0;
}

/* Checkbox styling */
li input[type="checkbox"] {
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* Better responsive layout for mobile */
@media (max-width: 768px) {
  li {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  li .todo-text {
    margin-left: 0;
    margin-right: 0;
    order: 1;
  }
  
  li input[type="checkbox"] {
    margin-right: 0;
    order: 0;
    align-self: flex-start;
  }
  
  li .todo-meta {
    margin-left: 0;
    order: 2;
  }
  
  li > div:last-child {
    order: 3;
    justify-content: center;
  }
}
/* Help Modal Content */
.help-modal-content {
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--modal-border);
  background: var(--modal-content-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-header h2 {
  margin: 0;
  color: var(--text-color);
}

.close-help {
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-color);
  line-height: 1;
}

.close-help:hover {
  color: var(--btn-color);
}

.modal-body {
  padding: 1.5rem;
  line-height: 1.6;
}

.modal-body h3 {
  color: var(--btn-color);
  border-bottom: 2px solid var(--btn-color);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.modal-body h4 {
  color: var(--text-color);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.feature-card {
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}

body.light-mode .feature-card {
  background: rgba(0, 0, 0, 0.03);
}

.kbd {
  background: var(--btn-color);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85em;
  font-weight: bold;
}

.pill-demo {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.75rem;
  margin: 2px;
}

.pill-demo.pill-high {
  border: 1px solid #ff4444;
  color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

.pill-demo.pill-medium {
  border: 1px solid #ffaa00;
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.1);
}

.pill-demo.pill-low {
  border: 1px solid #44dd44;
  color: #44dd44;
  background: rgba(68, 221, 68, 0.1);
}

.pill-demo.pill-overdue {
  border: 1px solid #ff5a5a;
  color: #ff5a5a;
  background: rgba(255, 90, 90, 0.1);
}

.modal-body ul {
  padding-left: 1.5rem;
}

.modal-body li {
  margin: 0.3rem 0;
}

.modal-body ol {
  padding-left: 1.5rem;
}

.modal-body code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

body.light-mode .modal-body code {
  background: rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .help-modal-content {
    width: 95%;
    max-height: 85vh;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
}
/* ===== Inline edit form tidy ===== */
.edit-container{
  display:flex;
  flex-wrap: wrap;
  gap:.5rem;
  align-items:center;
  padding:.6rem;
  border:1px solid var(--card-border);
  border-radius:8px;
  background: rgba(255,255,255,.03);
}

/* Big text field goes wide */
.edit-container .edit-text{
  flex: 1 1 420px;           /* wide on desktop */
  min-width: 220px;
  max-width: 100%;
  padding:.45rem .6rem;
  border:1px solid var(--input-border);
  border-radius:6px;
  background: var(--input-bg);
  color: var(--text-color);
  box-sizing: border-box;
}

/* Compact “chip-like” field groups */
.edit-container label,
.edit-container .edit-weekly-wrap,
.edit-container .edit-interval-wrap{
  display:flex;
  align-items:center;
  gap:.4rem;
  padding:.35rem .5rem;
  border:1px solid var(--input-border);
  border-radius:6px;
  background: var(--input-bg);
}

.edit-container input[type="date"],
.edit-container input[type="number"],
.edit-container input[type="text"].edit-tags,
.edit-container select{
  background: var(--input-bg);
  color: var(--text-color);
  border:1px solid var(--input-border);
  border-radius:5px;
  padding:.3rem .45rem;
  box-sizing: border-box;
}

/* Keep fields from blowing past the container */
.edit-container input,
.edit-container select{
  max-width: 100%;
}

/* Tiny Today button */
.edit-container .btn-today{
  padding:.3rem .5rem;
  border:1px solid var(--input-border);
  border-radius:6px;
  background:transparent;
  color: var(--text-color);
  cursor:pointer;
}

/* Save / Cancel to the right visually */
.edit-container .btn-save{
  margin-left:auto;          /* pushes Save (and then Cancel) to row end */
  border:1px solid var(--input-border);
  border-radius:6px;
  padding:.35rem .6rem;
  color:#0f0;
}
.edit-container .btn-save:hover{ background:rgba(0,255,0,.12); }

.edit-container .btn-cancel{
  border:1px solid var(--input-border);
  border-radius:6px;
  padding:.35rem .6rem;
  color:#f55;
}
.edit-container .btn-cancel:hover{ background:rgba(255,0,0,.12); }

/* Make it stack nicely on phones */
@media (max-width: 700px){
  .edit-container .edit-text{ flex:1 1 100%; }
  .edit-container label,
  .edit-container .edit-weekly-wrap,
  .edit-container .edit-interval-wrap{
    flex: 1 1 100%;
  }
}
/* Let tall groups align from the top instead of the middle */
.edit-container {
  align-items: flex-start; /* override center */
}

/* Each chip/group gets a sane minimum so it wraps instead of stretching */
.edit-container > * {
  flex: 0 1 auto;
  min-width: 140px;
}

/* Weekday row: allow wrapping neatly */
.edit-container .edit-weekly-wrap {
  flex-wrap: wrap;
  gap: .35rem .5rem;
}
.edit-container .edit-weekly-wrap label {
  /* keep the little day boxes compact */
  padding: 0;
  border: 0;
}

/* Keep the date group compact too */
.edit-container input[type="date"] {
  min-width: 140px;
}

/* Make Save/Cancel always end up on the last row, right side */
.edit-container .btn-save,
.edit-container .btn-cancel {
  order: 99;           /* push to the end row */
}
.edit-container .btn-save { 
  margin-left: auto;   /* stick to the right edge of that row */
}

/* Mobile polish */
@media (max-width: 700px){
  .edit-container > * { min-width: 100%; }  /* stack cleanly */
  .edit-container .btn-save { margin-left: 0; } /* full-width row */
}
.edit-container {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .5rem;
  max-width: 100%;       /* don't overflow parent */
}.edit-container > * {
  flex: 0 1 auto;
  min-width: 140px;      /* keeps things from shrinking too much */
}
.edit-container .edit-text {
  flex: 1 1 420px;       /* main text takes more space */
}
/* Hide checkboxes and delete button by default */
.select-todo,
#select-all,
#delete-btn {
  display: none;
}

/* Show checkboxes and delete button when in select mode */
.select-mode-active .select-todo,
.select-mode-active #select-all,
.select-mode-active #delete-btn {
  display: inline-block;
}

/* Style the select mode button */
#select-mode-btn {
  background: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  font-weight: bold;
}

#select-mode-btn:hover {
  background: var(--btn-color);
  color: white;
  transform: translateY(-1px);
}

/* Optional: Add visual feedback when in select mode */
.select-mode-active {
  --selection-highlight: rgba(0, 255, 255, 0.05);
}

.select-mode-active li {
  background: var(--selection-highlight);
  border-left: 3px solid transparent;
  transition: border-left-color 0.2s ease;
}

.select-mode-active li:hover {
  border-left-color: var(--accent);
}

/* Make sure checkboxes are properly spaced when shown */
.select-mode-active .select-todo {
  margin-right: 0.5rem;
  margin-left: 0;
}

/* Style for the select all area */
.select-mode-active #select-all {
  margin-right: 0.5rem;
}

/* Light mode adjustments */
body.light-mode.select-mode-active {
  --selection-highlight: rgba(0, 0, 0, 0.03);
}

body.light-mode #select-mode-btn:hover {
  background: var(--btn-color);
  color: white;
}
/* Hide checkboxes and delete button by default */
.select-todo,
#select-all,
#delete-btn {
  display: none;
}

/* Show checkboxes and delete button when in select mode */
.select-mode-active .select-todo,
.select-mode-active #select-all,
.select-mode-active #delete-btn {
  display: inline-block;


/* Hide checkboxes and delete button by default - ALWAYS HIDDEN */
.select-todo,
#select-all,
#delete-btn {
  display: none !important;
}

/* Remove the .select-mode-active rules since we're controlling via JavaScript */
/* Comment out or delete these CSS rules:

.select-mode-active .select-todo,
.select-mode-active #select-all,
.select-mode-active #delete-btn {
  display: inline-block;
}

*/

/* Keep the visual feedback styles */
.select-mode-active {
  --selection-highlight: rgba(0, 255, 255, 0.05);
}

.select-mode-active li {
  background: var(--selection-highlight);
  border-left: 3px solid transparent;
  transition: border-left-color 0.2s ease;
}

.select-mode-active li:hover {
  border-left-color: var(--accent);
}

/* Make sure checkboxes are properly spaced when shown */
.select-mode-active .select-todo {
  margin-right: 0.5rem;
  margin-left: 0;
}

/* Style for the select all area */
.select-mode-active #select-all {
  margin-right: 0.5rem;
}

/* Light mode adjustments */
body.light-mode.select-mode-active {
  --selection-highlight: rgba(0, 0, 0, 0.03);
}
/* Hide everything by default - including the Select All label */
.select-todo,
#select-all,
#delete-btn,
label[for="select-all"] {
  display: none;
}

/* Show when in select mode */
.select-todo.show,
#select-all.show,
#delete-btn.show,
label[for="select-all"].show {
  display: inline-block;
}
/* Make tasks clickable and add visual feedback */
.select-mode-active li {
  cursor: pointer; /* Show it's clickable */
}

.select-mode-active li:hover {
  background: rgba(0, 255, 255, 0.1); /* Brighter on hover */
}

/* Visual feedback for selected tasks */
.select-mode-active li.selected {
  border-left-color: var(--accent);
  background: rgba(0, 255, 255, 0.15);
}
/* ==============================
   ADMIN SECURITY - Hide buttons for non-admin users
============================== */

/* Hide task action buttons (✅, ✏️, ❌) when not logged in as admin */
body:not(.admin-logged-in) .todo-text + div button,
body:not(.admin-logged-in) li > div:last-child button {
  display: none !important;
}

/* Hide the entire controls section when not admin */
body:not(.admin-logged-in) .controls {
  display: none !important;
}

/* Optional: Add visual indicator that tasks are view-only for guests */
body:not(.admin-logged-in) li {
  cursor: default;
  opacity: 0.9;
}

/* Optional: Show a subtle "view only" message for guests */
body:not(.admin-logged-in) .card-container::before {
  content: "📖 View Only Mode - Login as admin to edit tasks";
  display: block;
  text-align: center;
  padding: 0.5rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 0, 0.1);
  border: 1px solid rgba(255, 255, 0, 0.3);
  border-radius: 6px;
  font-size: 0.9rem;
  color: #ffdd00;
}
/* Add this to your existing CSS file (todo.css) */

/* Delete confirmation modal specific styles */
.delete-modal-content {
  width: 90%;
  max-width: 500px;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.delete-modal-content .modal-header {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: white;
  padding: 1.5rem;
  text-align: center;
  border-bottom: none;
}

.delete-modal-content .modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.delete-modal-content .modal-body {
  padding: 1.5rem;
  text-align: center;
  background: var(--modal-content-bg);
  color: var(--text-color);
}

.delete-modal-content .modal-body p {
  margin: 0 0 1.5rem 0;
  font-size: 1.1rem;
  font-weight: 500;
}

/* Preview of tasks to be deleted */
.delete-task-preview {
  background: rgba(255, 68, 68, 0.05);
  border: 1px solid rgba(255, 68, 68, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  max-height: 200px;
  overflow-y: auto;
}

.delete-task-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.75rem;
  margin: 0.5rem 0;
  text-align: left;
}

.delete-task-item:first-child {
  margin-top: 0;
}

.delete-task-item:last-child {
  margin-bottom: 0;
}

.delete-task-text {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.delete-task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.delete-task-tags .pill {
  font-size: 0.7rem;
  padding: 1px 4px;
  opacity: 0.8;
}

.delete-more {
  text-align: center;
  font-style: italic;
  color: var(--text-color);
  opacity: 0.7;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal buttons */
.modal-buttons {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--modal-content-bg);
  justify-content: center;
  border-top: 1px solid var(--modal-border);
}

.delete-confirm-btn {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(255, 68, 68, 0.3);
  min-width: 120px;
}

.delete-confirm-btn:hover {
  background: linear-gradient(135deg, #ff6666, #ee0000);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 68, 68, 0.4);
}

.delete-confirm-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(255, 68, 68, 0.3);
}

.delete-cancel-btn {
  background: transparent;
  color: var(--text-color);
  border: 2px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.delete-cancel-btn:hover {
  background: var(--border-color);
  color: var(--bg-color);
  transform: translateY(-1px);
}

.delete-cancel-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Light mode adjustments */
body.light-mode .delete-task-preview {
  background: rgba(255, 68, 68, 0.03);
  border: 1px solid rgba(255, 68, 68, 0.15);
}

body.light-mode .delete-task-item {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .delete-more {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .delete-modal-content {
    width: 95%;
  }
  
  .delete-modal-content .modal-header {
    padding: 1rem;
  }
  
  .delete-modal-content .modal-header h2 {
    font-size: 1.2rem;
  }
  
  .delete-modal-content .modal-body {
    padding: 1rem;
  }
  
  .modal-buttons {
    flex-direction: column;
    padding: 1rem;
  }
  
  .delete-confirm-btn,
  .delete-cancel-btn {
    min-width: 100%;
    padding: 1rem;
  }
}

/* Animation for when tasks are being deleted */
@keyframes fadeOutDelete {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Apply animation to tasks being deleted */
.task-deleting {
  animation: fadeOutDelete 0.3s ease-out forwards;
}
/* Hide individual task delete buttons when in select mode */
.select-mode-active li .todo-meta + div button:last-child {
  display: none !important;
}

/* Alternative - hide all action buttons except the first one (✅) in select mode */
.select-mode-active li > div:last-child button:not(:first-child) {
  display: none !important;
}
