/* === Theme Variables === */

/* Light mode (default) */
:root {
  --color-background: #FAF9F6;
  --color-surface: #FFFFFF;
  --color-text: #1F1F1F;
  --color-accent-green: #6B8E23;
  --color-accent-red: #E53935;
  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* === CSS Reset === */
*, *::before, *::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
  font-size: 10px; /* ✅ keep root small so spacing stays balanced */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
ul, ol {
  list-style: none;
}
a {
  text-decoration: none;
  color: inherit;
}
button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
input, textarea, select {
  font: inherit;
  border: none;
  outline: none;
}
button:focus,
input:focus {
  outline: 2px solid var(--color-accent-green);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* === Header === */
header {
  text-align: center;
  margin-bottom: 1rem;
}
header h1 {
  font-size: 2.4rem; /* bigger heading */
  font-weight: 700;
  color: var(--color-text);
}

/* === App Container === */
.container {
  background: var(--color-surface);
  padding: 2rem;
  border-radius: 0.8rem;
  width: 100%;
  max-width: 50rem;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  font-size: 1.4rem; /* ✅ base font size for container */
}

/* === Task Input Row === */
#task-input {
  display: flex;
  gap: 0.5rem;
}
#new-task {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--color-border, #E5E1DA);
  border-radius: 4px;
  font-size: 1.4rem;
}
#add-task {
  background: var(--color-accent-green);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
#add-task:hover {
  background: #55731a;
}

/* === Task List === */
#task-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#task-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--color-border, #E5E1DA);
  border-radius: 4px;
  background: var(--color-surface);
  font-size: 1.4rem;
}
.task-text {
  flex: 1;
  margin-left: 0rem;
  padding-left: 1rem;
}
.task-completed .task-text {
  text-decoration: line-through;
  color: #6B6B6B;
  opacity: 0.7;
}
.delete-task {
  color: var(--color-accent-red);
  font-size: 1.4rem;
  margin-left: 0.5rem;
  cursor: pointer;
  background: none;
}

/* === Footer (mobile default) === */
footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1.3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border, #E5E1DA);
}
#task-count {
  color: var(--color-text);
}
#filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
#filters button {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--color-border, #E5E1DA);
  background: var(--color-surface);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.3rem;
}
#filters button:hover {
  border-color: var(--color-accent-green);
  color: var(--color-accent-green);
}
#filters .active {
  border-color: var(--color-accent-green);
  background: var(--color-accent-green);
  color: #fff;
  font-weight: 600;
}
#filters .active:hover {
  color: #fff;
}
#clear-completed {
  color: var(--color-accent-red);
  cursor: pointer;
  font-size: 1.3rem;
  transition: color 0.2s ease;
}
#clear-completed:hover {
  color: #b71c1c;
}

/* === Tablet (768px–1023px) === */
@media (min-width: 768px) and (max-width: 1023px) {
  .container {
    max-width: 70rem;
    padding: 2.5rem;
    font-size: 1.5rem; /* slightly bigger text */
  }
  footer {
    flex-direction: column;
    gap: 1.5rem;
    font-size: 1.4rem;
  }
  .footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  #filters {
    justify-content: center;
    margin: 0 auto;
  }
}

/* === Desktop (1024px+) === */
@media (min-width: 1024px) {
  .container {
    max-width: 96rem;
    padding: 3rem;
    font-size: 1.6rem; /* even bigger base text */
  }
  footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    font-size: 1.4rem;
  }
  #filters {
    flex: 1;
    justify-content: center;
  }
  #task-count {
    text-align: left;
    flex: 1;
  }
  #clear-completed {
    text-align: right;
    flex: 1;
  }
}