@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;500&display=swap");

* {
  box-sizing: border-box;
}

@view-transition {
  navigation: auto;
}

html,
body {
  background-color: black;
  font-family: "Roboto", sans-serif;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}
.img-credit {
  position: absolute;
  inset: 2em auto auto 2em;
  color: white;
  font-size: 12px;
  font-weight: 300;
}
.img-credit a,
a:hover,
a:focus,
a:visited {
  color: white;
  opacity: 0.6;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid white;
}
.container {
  position: fixed;
  inset: auto 2em 2em auto;
  background-color: white;
  width: fit-content;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  border-radius: 10px;
  transition-property: width;
  transition-duration: 4s;
  transition-delay: 2s;
}

.row {
  max-height: 50vh;
  overflow: hidden;
  overflow-y: auto;
  padding: 4em 4em 0;
}

.row.has-content {
  overflow-y: scroll;
}

.row > * {
  margin: 0;
  padding: 0;
}

.row h1 {
  margin-bottom: 0.5em;
}

small {
  display: block !important;
  color: rgb(136, 136, 136);
  margin-top: 25px;
  font-weight: 300;
}

button.add-to-do {
  background-color: black;
  border: none;
  padding: 12px 24px;
  color: white;
  font-size: 16px;
  border-radius: 20px;
  cursor: pointer;
}
button.delete {
  background-color: transparent;
  border: none;
  font-size: large;
  cursor: pointer;
}
label {
  display: flex;
  align-items: center;
}
input[type="text"] {
  width: 100%;
  font-size: 16px;
  padding: 5px 0;
  border: none;
  margin: 1em 0;
}
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 50%;
  border: 3px solid #151617;
  min-width: 15px;
  height: 15px;
  margin-right: 10px;
}
input[type="checkbox"]:checked {
  background: black;
  outline: 0;
}
.task {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1em 0;
  border-bottom: 1px solid rgb(235, 235, 235);
  font-weight: 300;
  word-wrap: break-word; /* For legacy support */
  overflow-wrap: break-word; /* Modern standard */
  word-break: break-word; /* Optional: breaks long unbreakable strings */
}
.task label {
  width: -webkit-fill-available;
}
.task span {
  font-family: "Roboto", sans-serif;
  cursor: pointer;
  margin-left: 10px;
}
.task-complete label {
  text-decoration: line-through;
  opacity: 0.5;
}
::placeholder {
  color: #ccc;
}

input:focus {
  outline: 0;
}
.alert {
  width: 100%;
  background-color: red;
  color: white;
  font-size: 14px;
  padding: 1em;
  font-weight: 300;
}
.controls {
  margin-top: 1em;
  padding: 0 4em 4em;
}

/** Todo toggles **/
.toggle-buttons {
  position: absolute;
  inset: 2rem 2rem auto auto;
  width: fit-content;
  display: flex;
}

.toggle-buttons button {
  background-color: transparent;
  border: none;
  color: white;
}

.toggle-buttons p:first-of-type {
  display: inline;
}

.switch {
  position: relative;
  display: inline-block;
  width: 35px; /* 50% of original 70px */
  height: 20px; /* 50% of original 40px */
}

.switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
}

.switch input:checked + .knob {
  background-color: #4bd663;
}

.switch input + .knob {
  transition: all 0.3s ease-in;
}

.switch input + .knob:before {
  transition: all 0.3s ease-in;
}

.switch input:checked + .knob:before {
  transform: translateX(15px); /* Was 30.4px → now ~15px */
  box-shadow: -5px 0px 22px 0px; /* Optional: scale this down too */
}

.knob {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 20px; /* 50% of original 40px */
}

.knob:before {
  position: absolute;
  background-color: white;
  content: "";
  left: 2px; /* Adjusted from 4px */
  top: 2px; /* Adjusted from 4px */
  width: 16px; /* 50% of original 32px */
  height: 16px;
  border-radius: 50%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

/** Mobile **/
@media (max-width: 650px) {
  html,
  body {
    background-image: none;
  }
  .container {
    position: relative;
    padding: 2em;
    inset: 0;
    min-height: 100vh;
    border-radius: 0;
    width: 100%;
  }
  .row,
  .controls {
    padding: 0;
    max-height: fit-content;
    overflow: auto;
  }
}
