/* Import fonts */
@import url("https://fonts.googleapis.com/css?family=Inter:700|Inter:400");
@import "./base.css";
@import "./components.css";
@import "./responsive.css";

/* Variables */
:root {
  --text: #0f0316;
  --background: #fffefc;
  --primary: #799a8d;
  --secondary: #fffcf0;
  --accent: #26736e;
}

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

body {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  background-color: var(--primary);
  color: var(--text);
}

main {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.input-container {
  background-color: var(--background);
  padding: 25px;
  min-width: 50%;
  max-width: 70%;
  border-radius: 10px;
}

#input-field::placeholder {
  white-space: normal;
  word-wrap: break-word;
  font-size: 0.9rem;
  text-align: center;
}

.to-do-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.to-do-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgb(228, 228, 228);
  margin-bottom: 25px;
  border-radius: 40px;
  margin: 10px;
  padding-right: 0px;
  padding-left: 20px;
}

.to-do-body input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 15px 0;
}

.to-do-body img {
  cursor: pointer;
  border-radius: 40px;
  height: 45px;
}

.detail-level {
  display: flex;
  gap: 10px;
  margin: 20px;
}

ul li {
  list-style: none;
  font-size: 18px;
  cursor: pointer;
  padding: 10px;
}

h5 {
  text-align: center;
  margin-bottom: 10px;
  color: var(--accent);
}

.todo-controls {
  width: 25px;
  height: 25px;
  padding: 3px;
  margin-right: 5px;
}

.task-container {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem;
  background: rgb(228, 228, 228);
  border-radius: 5px 5px 0 0;
}

.controls-container {
  display: flex;
  align-items: center;
}

.collapse-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
  padding: 5px 10px;
  transition: opacity 0.2s;
  opacity: 0.7;
  user-select: none;
}

.collapse-btn:hover {
  opacity: 1;
}

.completed {
  text-decoration: line-through;
  color: #666;
}

.to-do-item {
  margin-bottom: 0.5rem;
  border-radius: 5px;
  overflow: hidden;
}

.to-do-item span {
  font-weight: bold;
  margin: 0.75rem;
  flex: 1;
}

.delete-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 24px;
  cursor: pointer;
  padding: 10px 20px;
  transition: color 0.2s;
  opacity: 0.7;
}

.delete-btn:hover {
  opacity: 1;
  color: #ff4444;
}

.sub-tasks {
  padding: 0.5rem 2rem;
  background: rgb(228, 228, 228);
  margin: 0;
  border-radius: 0 0 5px 5px;
}

.sub-task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
  font-size: 0.9em;
  color: var(--text);
  padding: 5px 0;
  font-weight: normal;
}

.sub-task-item:only-child {
  color: #666;
  font-style: italic;
}

input[type="checkbox"] {
  appearance: none;
  min-width: 20px;
  min-height: 20px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 5px;
  cursor: pointer;
  background-color: var(--background);
  transition: background-color 0.2s, border-color 0.2s;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

input[type="checkbox"]:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: "";
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  display: block;
  margin-bottom: 2px;
}

@media (max-width: 768px) {
  .input-container {
    min-width: 90%;
    margin-top: 20px;
  }

  #output {
    width: 100%;
  }

  .task-container {
    width: 100%;
  }
}
