body {
  font-family: "Fredoka One", cursive;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  transition: background-color 0.5s;
  background-color: #f0f0f0;
}
#timer-container {
  text-align: center;
  transition: opacity 0.5s;
  background-color: white;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
#timer {
  font-size: 8rem;
  margin-bottom: 1rem;
  color: #333;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}
input {
  margin: 0.5rem;
  padding: 0.8rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-family: "Fredoka One", cursive;
  background-color: #f0f0f0;
  color: #333;
  text-align: center;
}
#taskInput {
  width: calc(100% - 3rem); /* Full width minus margins */
  margin-bottom: 1rem;
  font-style: italic;
  display: inline-block; /* Add this to keep it inline with other inputs */
}
button {
  margin: 0.5rem;
  padding: 0.8rem 2rem; /* Increased padding */
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-family: "Fredoka One", cursive;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  min-width: 150px; /* Changed from width to min-width */
}
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
button:active {
  transform: translateY(0);
  box-shadow: none;
}
#toggleBtn {
  background-color: #4caf50;
  color: white;
}
#toggleBtn.pause-state {
  background-color: #ffc107;
  color: #333;
}
#resetBtn {
  background-color: #f44336;
  color: white;
}
#status {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
  width: calc(100% - 3rem);
  text-align: center;
  background: transparent;
  border: none;
  padding: 0.5rem;
  position: relative;
  cursor: pointer;
}

#status-container {
  position: relative;
  display: inline-block;
}

.edit-indicator {
  position: absolute;
  right: 1rem;
  top: 40%;
  transform: translateY(-50%);
  color: #666;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  font-size: 1.6rem; /* Make the pencil icon bigger */
}

#status-container:hover .edit-indicator {
  opacity: 1;
}

#status:focus {
  outline: none;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

#status::placeholder {
  color: #333;
  opacity: 1;
}
#history-container {
  margin-top: 2rem;
  text-align: left;
  width: 100%;
  max-width: 600px;
}
#history-container h2 {
  font-size: 1.5rem;
  color: #333;
}
#history-list {
  list-style-type: none;
  padding: 0;
}
#history-list li {
  margin: 0; /* Remove all margins */
  font-size: 1rem;
  color: #333;
}
#history-list li.date-header {
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}
#history-list li.date-header::before {
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  transform: rotate(0);
  transition: transform 0.3s ease;
}
#history-list li.date-header.expanded::before {
  transform: rotate(90deg);
}
#history-list li.date-header + ul,
#history-list li.date-header + div {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}
#history-list li.date-header.expanded + ul,
#history-list li.date-header.expanded + div {
  max-height: 1000px;
  transition: max-height 0.6s cubic-bezier(0.9, 0, 0.8, 0.2);
}
#history-list ul {
  list-style-type: none;
  padding-left: 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}
#history-list li.expanded + ul {
  max-height: 1000px; /* Larger value to accommodate more content */
  transition: max-height 0.6s cubic-bezier(0.9, 0, 0.8, 0.2);
}
#history-list ul li,
#history-list .older-list-container li {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#history-list li.expanded + ul li,
#history-list li.date-header.expanded + div li {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(0.2s + (var(--item-index, 0) * 0.05s));
}

/* Style for the 'Tidligere' section */
#history-list .older-list-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

#history-list li.date-header.expanded + .older-list-container {
  max-height: 1000px;
  transition: max-height 0.6s cubic-bezier(0.9, 0, 0.8, 0.2);
}

#history-list .older-list-container li {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#history-list li.date-header.expanded + .older-list-container li {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(0.1s + (var(--item-index, 0) * 0.05s));
}

.delete-data-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #f44336;
  color: white;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-family: "Fredoka One", cursive;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  width: calc(100px + 3rem); /* Volume slider width + padding */
}
.delete-data-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.delete-data-btn:active {
  transform: translateY(0);
  box-shadow: none;
}
.delete-cycle-btn {
  background-color: transparent;
  border: none;
  color: #fb8282;
  font-size: 1rem;
  cursor: pointer;
  padding: 0; /* Remove padding */
  min-width: 0; /* Override the min-width from button */
  width: auto; /* Let the width be determined by content */
  margin: 0 0 0 10px; /* Add margin only on the left side */
}
.hidden {
  opacity: 0;
  transition: opacity 0.5s;
}

#muteBtn {
  background-color: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: 0.5rem;
  padding: 0; /* Remove padding */
  margin: 0; /* Remove margin */
  width: 40px; /* Set width to fit the icon */
  height: 40px; /* Set height to make it square */
  min-width: unset; /* Override min-width from button */
  flex-shrink: 0;
  z-index: 2; /* Ensure button stays on top */
}

#volume-control {
  position: fixed;
  bottom: 80px; /* Position above the delete button */
  right: 20px;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 20px;
  padding: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 40px; /* Initial width to fit just the button */
  transition: width 0.3s ease; /* Smooth width transition */
  overflow: visible; /* Change from hidden to visible */
}

#volume-control:hover {
  width: 160px; /* Expanded width to fit button + slider */
}

#volume-control input[type="range"] {
  display: block; /* Override previous display: none */
  width: 100px;
  margin-left: 0.5rem;
}

#volume-control:hover input[type="range"] {
  display: inline-block; /* Show the slider on hover */
}

#volume-control label {
  margin-right: 0.5rem;
}

#volumeSlider {
  position: absolute; /* Position the slider absolutely */
  left: 35px; /* Position it after the button */
  width: 100px;
  opacity: 0;
  transition: opacity 0.3s ease; /* Smooth fade in/out */
  padding: 0 10px; /* Add padding for better edge access */
}

#volume-control:hover #volumeSlider {
  opacity: 1;
}

#muteCheckbox {
  margin-right: 0.25rem;
}
