/* Root Variables */
:root {
  --bg-main: #121314;
  --bg-card: #151515;
  --primary: #4f8cff;
  --secondary: #7c7c8a;

  --text-main: #ffffff;
  --text-muted: #a1a1aa;

  --success: #22c55e;
  --danger: #ef4444;
  --border: #23262f;
}

[data-theme="light"] {
  --bg-main: #f5f7fa;
  --bg-card: #f4f6ff;
  --primary: #2563eb;
  --secondary: #64748b;

  --text-main: #0f172a;
  --text-muted: #6b7280;

  --success: #16a34a;
  --danger: #dc2626;
  --border: #e5e7eb;
}

/* Toggle knob */
.theme-label::after {
  content: "🌙";
  width: 60px;
  height: 30px;
  background: var(--bg-main);
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  display: grid;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  transition: all 0.3s ease;
}

/* Checked (Light mode) */
.theme-checkbox:checked + .theme-label {
  background: var(--primary);
}




.theme-checkbox:checked + .theme-label::after {
  transform: translateX(30px);
  content: "☀️";
}

.theme-checkbox {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  opacity: 0;
  cursor: pointer;
  padding-left: 5px;
}

.theme-label {
  width: 72px;
  height: 38px;
  background: var(--border);
  border-radius: 50px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
}

/* Global Styles */
hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 20px 0;
  opacity: 0.25;
}

/* Reset and base styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  padding: 20px;
  min-height: 100vh;
  transition:
    background 0.3s,
    color 0.3s;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 25px;
}

header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin-bottom: 24px;
}

.theme-toggle {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 1000;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

.app-container {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 30px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.input-section {
  padding: 25px;
  border-bottom: 1px var(--border);
  background: var(--bg-card);
}

.input-group {
  display: flex;
  gap: 10px;
}

#todo-input {
  flex: 1;
  padding: 15px;
  border: 2px solid #dde6ed;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

#todo-input:focus {
  outline: none;
  border-color: #ff9b51;
}

.todos-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  padding: 20px;
  content: none;
  cursor: pointer;
}

#add-btn {
  padding: 15px 25px;
  background-color: #ef7722;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.3s;
}

#add-btn:hover {
  background-color: #ef7722;
}

.filters {
  padding: 15px 25px;
  display: flex;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px  var(--border);
  color: var(--text-main);
}

.filter-btn {
  padding: 8px 16px;
  border: none;

  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.filter-btn:hover {
  background-color: #dee2e6;
}

.filter-btn.active {
  background-color: #ef7722;
  color: white;
}

.todos-section {
  padding: 0;
}

.section-title {
  padding: 20px 25px 15px;
  font-size: 1.2rem;
  border-bottom: 1px var(--border);
}

.todos-container {
  max-height: 400px;
  overflow-y: auto;
}

.todo-item {
  padding: 18px 25px;
  border-bottom: 1px var(--border);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: background-color 0.2s;
}

.todo-item:hover {
  background-color: #f9f9f9;
}

.todo-item.completed {
  background: var(--bg-card);
  text-decoration: line-through; /* This is the key property */
  color: #000; /* Optional: change color to indicate completion */
  opacity: 0.7; /* Optional: dim the completed task */
}

input[type="checkbox"] {
  /* Add if not using autoprefixer */
  -webkit-appearance: none;
  /* Remove most all native input styles */
  appearance: none;
  /* For iOS < 15 */
  background-color: var(--form-background);
  /* Not removed via appearance */
  margin: 0;

  font: inherit;
  color: currentColor;
  width: 1.15em;
  height: 1.15em;
  border: 0.15em solid currentColor;
  border-radius: 0.15em;
  transform: translateY(-0.075em);
  cursor: pointer;

  display: grid;
  place-content: center;
}

.todo_item.completed .todo-text {
  text-decoration: line-through;
  opacity: 0.6; /* optional: makes it look nicer */
  color: var(--text-muted);
}


body.dark {
  --form-control-color: #ffffff; /* white tick ✔ */
}
body.light {
  --form-control-color: #000000; /* black tick ✔ */
}
/* Create the checkmark using a pseudo element*/
input[type="checkbox"]::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transform-origin: bottom left;
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--form-control-color);

  
  /* Windows High Contrast Mode */
  background-color: CanvasText;
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:focus {
  outline: max(2px, 0.15em) solid currentColor;
  outline-offset: max(2px, 0.15em);
}

.todo-text {
  flex: 1;
  font-size: 1rem;
}

.todo-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  width: 59px;
  height: 25px;
  border-radius: 10px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn i {
  font-size: 16px;
}

.edit-btn {
  background-color: #ffd95e;
  color: #2c2204;
}

.edit-btn:hover {
  background-color: #ffd446;
  box-shadow: var(--shadow-light);
}

.delete-btn {
  background-color: #f34f3a;
  color: #ffffff;
}

.delete-btn:hover {
  background-color: #ff2036;
  box-shadow: var(--shadow-light);
}

.stats {
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #eee;
  background: var(--bg-card);
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 15px;
  color: #dee2e6;
}

.author-text {
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
a {
  color: var(--text-main);
  text-decoration: none;
}

.instructions {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  margin-top: 30px;
}

.instructions h3 {
  margin-bottom: 15px;
}

.instructions ul {
  padding-left: 20px;
  margin-bottom: 20px;
}

.instructions li {
  margin-bottom: 8px;
}

.highlight {
  background: var(--bg-card);
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .container {
    padding: 10px;
  }

  .input-group {
    flex-direction: column;
  }

  #add-btn {
    width: 100%;
  }

  .filters {
    flex-wrap: wrap;
  }
}



/* Modal */

.modal{
position: fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.5);
display:none;
align-items:center;
justify-content:center;
z-index:1000;
}

.modal-content{
background:#1f2937;
padding:30px;
border-radius:12px;
width:350px;
text-align:center;
color:white;
}

.modal-buttons{
margin-top:20px;
display:flex;
justify-content:flex-end;
gap:10px;
}

.modal-buttons button{
padding:10px 16px;
border:none;
border-radius:6px;
cursor:pointer;
}

#confirm-btn{
background:#ff6b6b;
color:white;
}

#cancel-btn{
background:#444;
color:white;
}

#edit-input{
width:100%;
padding:10px;
margin-top:15px;
border-radius:6px;
border:none;
}