/* -------------------------------------
   VARIABLES – LIGHT MODE (DEFAULT)
--------------------------------------*/
:root {
  --color-bg: #ffffff;
  --color-bg-soft: #f5f5f7;
  --color-card: #ffffff;
  --color-text: #1d1d1f;
  --color-text-light: #6e6e73;
  --color-primary: #007aff;
  --color-border: #e2e2e6;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ------------------------------
   RESET
--------------------------------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden; /* Para que NO haya scroll general */
}

html {
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
}

/* ------------------------------
   BODY LAYOUT
--------------------------------*/
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  background: var(--color-bg);
  color: var(--color-text);
  transition: background 0.3s ease, color 0.3s ease;

  padding: 5px;
  line-height: 1.5;
}

/* Contenido con scroll interno */
main {
  flex: 1;
  overflow-y: auto; /* Permite scroll SOLO aquí */
  padding-bottom: 2rem;
}
.container{
   max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ------------------------------
   HEADER
--------------------------------*/
.header {
  margin-bottom: 2rem;
  text-align: center;
}

.header__title {
  font-size: 2.2rem;
  margin-top: 0.5rem;
  font-weight: 700;
}

.header__controls {
  display: flex;
  justify-content: flex-end;
  margin: 10px 100px;
}

.theme-toggle {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  padding: 0.6rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s ease;
}

.theme-toggle:hover {
  background: var(--color-border);
}

/* ------------------------------
   FORM
--------------------------------*/
.task-form {
  background: var(--color-card);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
  max-width: 600px;
  margin: 0 auto 2rem auto;
}

.task-form__label {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  display: block;
  color: var(--color-text-light);
}

.task-form__input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  margin-bottom: 1rem;
  font-size: 1rem;
  background: var(--color-bg-soft);
  transition: 0.25s ease;
}

.task-form__input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-bg);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.task-form__button {
  background: var(--color-primary);
  color: #fff;
  padding: 0.8rem 1.4rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: 0.25s ease;
}

.task-form__button:hover {
  opacity: 0.85;
}

/* ------------------------------
   TASK LIST
--------------------------------*/
.task-list {
  list-style: none;
  max-width: 600px;
  margin: 0 auto;
}

.task-item {
  background: var(--color-card);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;

  animation: fadeIn 0.25s ease;
}

.task-item__text {
  flex-grow: 1;
  font-size: 1.1rem;
}

.task-item__btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  transition: 0.25s ease;
}

.task-item__btn:hover {
  transform: scale(1.15);
}

.task-item__btn--delete {
  color: #ff3b30;
}

.task-item__btn--edit {
  color: var(--color-primary);
}

/* ------------------------------
   FOOTER
--------------------------------*/
.footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-light);
  padding: 1rem 0;
  width: 100%;
  background: var(--color-bg-soft);
  border-top: 1px solid var(--color-border);
}

/* ------------------------------
   DARK THEME
--------------------------------*/
/* -------------------------------------
   VARIABLES – DARK MODE
--------------------------------------*/
body.dark-theme {
  --color-bg: #1c1c1e;
  --color-bg-soft: #2c2c2e;
  --color-card: #2c2c2e;
  --color-text: #f5f5f7;
  --color-text-light: #98989d;
  --color-primary: #0a84ff;
  --color-border: #3a3a3c;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
}


/* ------------------------------
   ANIMATIONS
--------------------------------*/
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------
   RESPONSIVE DESIGN
--------------------------------*/
@media (max-width: 480px) {
  .header__title {
    font-size: 1.8rem;
  }

  .task-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .task-item__btn {
    font-size: 1.5rem;
  }

  .theme-toggle {
    padding: 0.4rem 0.8rem;
  }
}
