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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
  position: relative;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  opacity: 0.9;
  font-size: 0.9rem;
}

.logout-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.3s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

main {
  padding: 30px;
}

.add-todo-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

#newTodoInput,
#newTodoContent {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

#newTodoContent {
  resize: vertical;
  min-height: 60px;
}

#newTodoInput:focus,
#newTodoContent:focus {
  outline: none;
  border-color: #667eea;
}

#addTodoBtn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#addTodoBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#addTodoBtn:active {
  transform: translateY(0);
}

.stats {
  display: flex;
  justify-content: space-around;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: #666;
}

.todo-list {
  min-height: 200px;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 10px;
  transition: all 0.3s;
}

.todo-item:hover {
  background: #f0f0f0;
  transform: translateX(4px);
}

.todo-item.completed {
  opacity: 0.6;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: #999;
}

.todo-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.todo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.todo-text {
  font-size: 1rem;
  font-weight: 500;
  color: #333;
}

.todo-description {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.todo-actions {
  display: flex;
  gap: 8px;
}

.delete-btn {
  padding: 6px 12px;
  background: #ff4757;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.3s;
}

.delete-btn:hover {
  background: #ff3838;
}

.loading, .empty-state, .error-state {
  text-align: center;
  padding: 40px;
  color: #999;
}

.error-state {
  color: #ff4757;
}

footer {
  text-align: center;
  padding: 20px;
  background: #f5f5f5;
  color: #999;
  font-size: 0.85rem;
}

/* Login Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
}

.modal-content h2 {
  margin-bottom: 10px;
  color: #333;
  text-align: center;
}

.modal-subtitle {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 30px;
}

#loginForm {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#loginForm input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

#loginForm input:focus {
  outline: none;
  border-color: #667eea;
}

#loginForm button {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#loginForm button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#loginForm button:active {
  transform: translateY(0);
}

.login-error {
  color: #ff4757;
  font-size: 0.9rem;
  text-align: center;
  min-height: 20px;
}

@media (max-width: 600px) {
  header h1 {
    font-size: 2rem;
  }

  #addTodoBtn {
    width: 100%;
  }

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

  .todo-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
