/* ==========================================
   RESET & BASE STYLES
   ========================================== */

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

body {
  font-family: 'Georgia', serif;
  background: #faf8f3;
  min-height: 100vh;
  padding: 40px 20px;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139, 69, 19, 0.02) 2px, rgba(139, 69, 19, 0.02) 4px);
  pointer-events: none;
}

/* ==========================================
   LAYOUT
   ========================================== */

.container {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

/* ==========================================
   HEADER SECTION
   ========================================== */

#main-header {
  background: #fff;
  border-radius: 2px;
  padding: 40px 45px;
  margin-bottom: 25px;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.04);
  border-top: 4px solid #8b4513;
  position: relative;
}

#main-header::after {
  content: '✎';
  position: absolute;
  top: 40px;
  right: 45px;
  font-size: 28px;
  color: #d4a574;
  opacity: 0.3;
}

h1 {
  color: #3d2817;
  margin-bottom: 28px;
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  font-family: 'Georgia', serif;
  font-style: italic;
}

/* ==========================================
   TODO FORM
   ========================================== */

#todo-form {
  display: flex;
  gap: 12px;
}

#task-input {
  flex: 1;
  padding: 14px 18px;
  border: none;
  border-bottom: 2px solid #d4a574;
  border-radius: 0;
  font-size: 17px;
  font-family: 'Georgia', serif;
  background: #faf8f3;
  color: #3d2817;
  transition: all 0.3s ease;
}

#task-input:focus {
  outline: none;
  border-bottom-color: #8b4513;
  background: #fff;
}

#task-input::placeholder {
  color: #baa286;
  font-style: italic;
}

button[type="submit"] {
  padding: 14px 32px;
  background: #8b4513;
  color: #faf8f3;
  border: none;
  border-radius: 2px;
  font-size: 16px;
  font-weight: 400;
  font-family: 'Georgia', serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
  letter-spacing: 0.5px;
}

button[type="submit"]:hover {
  background: #6d3710;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
  transform: translateY(-1px);
}

button[type="submit"]:active {
  transform: translateY(0);
}

/* ==========================================
   MAIN CONTAINER
   ========================================== */

#main-container {
  background: #fff;
  border-radius: 2px;
  padding: 40px 45px;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.04);
  border-top: 4px solid #8b4513;
}

/* ==========================================
   STATISTICS
   ========================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid #e8dcc8;
}

.stats li {
  text-align: center;
  padding: 20px 15px;
  background: #faf8f3;
  border-radius: 2px;
  transition: all 0.3s ease;
  position: relative;
}

.stats li::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: #d4a574;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stats li:hover {
  background: #f5f0e8;
  transform: translateY(-2px);
}

.stats li:hover::before {
  opacity: 1;
}

.stats li span:first-child {
  display: block;
  color: #8b7355;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  font-family: 'Georgia', serif;
}

.stats li span:last-child {
  display: block;
  font-size: 36px;
  font-weight: 400;
  color: #8b4513;
  font-family: 'Georgia', serif;
  font-style: italic;
}

/* ==========================================
   TODO LIST
   ========================================== */

.todos {
  margin-bottom: 2rem;
  list-style: none;
}

.todos li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  margin-bottom: 12px;
  background: #faf8f3;
  border-radius: 2px;
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
  position: relative;
}

.todos li::before {
  content: '"';
  position: absolute;
  left: 8px;
  top: 15px;
  font-size: 32px;
  color: #d4a574;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-family: 'Georgia', serif;
}

.todos li:hover {
  background: #f5f0e8;
  border-left-color: #d4a574;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.todos li:hover::before {
  opacity: 0.3;
}

.todos li.complete {
  opacity: 0.5;
}

.todos li.complete span {
  text-decoration: line-through;
  color: #8b7355;
}

.todos li > div {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.todos li span {
  color: #3d2817;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  font-family: 'Georgia', serif;
}

.task-date {
  display: block;
  font-size: 12px;
  color: #8b7355;
  font-style: italic;
  margin-top: 4px;
  margin-bottom: 4px;
}

/* ==========================================
   TODO CONTROLS
   ========================================== */

.todos li input[type="checkbox"] {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: #8b4513;
  border-radius: 2px;
}

.todos li button {
  padding: 8px 18px;
  background: transparent;
  color: #c4694a;
  border: 1px solid #d4a574;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 400;
  font-family: 'Georgia', serif;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0;
}

.todos li:hover button {
  opacity: 1;
}

.todos li button:hover {
  background: #c4694a;
  color: #fff;
  border-color: #c4694a;
  box-shadow: 0 2px 8px rgba(196, 105, 74, 0.3);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 640px) {
  body {
    padding: 20px 15px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  #main-header,
  #main-container {
    padding: 30px 25px;
  }
  
  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  #todo-form {
    flex-direction: column;
  }
  
  button[type="submit"] {
    width: 100%;
  }
  
  .todos li {
    padding: 18px 20px;
  }
}