body{
    background: whitesmoke;
    
}
*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}
h2{
    margin-top: 5px;
    font-size: 2rem;
    margin-bottom: 1rem;
  flex-shrink: 0;
  font-weight: bold;
  
}

.container{
    display: flex;
  flex-direction: column;
  justify-content: flex-start; /* <-- important */
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  
  overflow-y: auto; /* allows scrolling if content is taller than the screen */
    
    
}

.app-container{
   
    min-width: 300px; 
    max-width: 100%;
    min-height: fit-content;
    
    border-radius: 2rem;
    padding: 2rem;
    text-align: center;

    background: rgb(218, 218, 218);
    
}


form {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 1rem auto;
}
input{
    border-radius: 1rem;
    border: 0.1rem solid black;
    background-color: rgba(192, 186, 186, 0.273);
    padding: 0.4rem;
    width: 100%;  /* Make the input box take full width */
}

#input-box {
    width: 100%;
    padding: 0.6rem 4rem 0.6rem 1rem; 
    border-radius: 1rem;
    border: 0.1rem solid rgba(0, 0, 0, 0.183);
    background-color: rgba(24, 175, 45, 0.273);
    height: 40px;
    font-size: 1rem;
    box-sizing: border-box;
    
}

#input-box:focus {
    outline: none;
}

#add-button {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    padding: 0 1rem;
    border: none;
    background-color: black;
    color: rgb(188, 188, 188);
    border-radius: 1rem;
    border: 2px solid black;
    font-size: 0.8rem;
    font-weight: bold; 
    cursor: pointer;
}
#add-button:hover{
    transition: 300ms;
    color: rgb(37, 227, 139);

}

ul li{
    list-style: none;
    padding: 0.4rem;
    
}

.todo {
    margin-bottom: 10px;
    padding: 0 16px;
    background-color: rgba(136, 136, 136, 0.127);
    border-radius: 1rem;
    display: flex;
    align-items: center; /* Align items vertically */
    height: 40px;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.todo .todo-text {
    padding: 0 15px;
    transition: 200ms ease;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 40px; 
}
.todo-text {
    word-wrap: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    flex: 1 1 auto;
  text-align: left;
  word-break: break-word;
  line-height: 1.4;
  text-transform: uppercase;
  font-weight: bold; 
  color: rgb(82, 82, 82);
  
  transition: font-size 0.3s ease;


}
.todo-text:hover {
    font-size: 1.05rem; /* Change to a larger size on hover */
}

.delete-button {
    background: none;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: absolute;
    right: 10px; /* Keeps the button on the right side */
}

.delete-button svg:hover{
    transition: 300ms;
    fill: red;
}

.custom-checkbox{
    border: 0.1rem solid rgb(0, 0, 0);
    border-radius: 15px;
    min-height: 20px;
    min-width: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: 300ms ease;
    cursor: pointer;
}

input[type="checkbox"] {
    display: none;
}


.custom-checkbox svg {
    display: none;
    cursor: pointer;
}


input[type="checkbox"]:checked + label.custom-checkbox svg {
    display: inline;
    fill: black;
}


input[type="checkbox"]:checked + label.custom-checkbox {
    background-color: rgb(0, 0, 0);
}


input[type="checkbox"]:checked + label.custom-checkbox + label.todo-text {
    text-decoration: line-through;
    color: rgba(254, 41, 41, 0.273);
}

@media (min-height: 500px) {
    .container {
      justify-content: center;
    }
  }

@media (max-width: 500px) {
    form {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      position: static; /* remove absolute positioning on small screens */
    }
  
    #input-box {
      padding: 0.6rem 1rem;
      border-radius: 1rem;
      width: 100%;
    }
  
    #add-button {
      position: static;       /* remove absolute positioning */
      width: 100%;            /* full width */
      margin-top: 0.5rem;
      border-radius: 1rem;
      height: 40px;
    }
  
    .todo {
      flex-wrap: wrap;
      height: auto;
      width: 100%;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      padding: 10px;
      gap: 10px;
    }
  
    .todo-text {
      flex: 1 1 100%;
      text-align: left;
    }
  }
    