* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.container {
    width: 90%;
    max-width: 950px;
    max-height: 100%;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
}

h2 {
    color: #555;
}

.tab {
    overflow: hidden;
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.tab button {
    background-color: #007bff; /* Default color */
    color: white;
    border: none;
    outline: none;
    cursor: pointer;
    margin: 0 5px;
    border-radius: 5px;
    font-size: 17px;
    transition: background-color 0.3s;
}

@media (min-width: 700px) {
.tab button {
    padding: 14px 30px;
}
}

.tab button:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

.tab button.active {
    background-color: #28a745; /* Green color for the active tab */
}

.tabcontent {
    display: none; /* Hidden by default */
}

.tabcontent.active {
    display: block; /* Show active tab content */
}

.smalltabs {
  justify-content: start;
}
.smalltabs .tablinks {
  padding: 5px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input, textarea, button {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

button {
    background-color: #28a745;
    color: white;
    cursor: pointer;
}

button:hover {
    background-color: #218838;
}

ul {
    list-style-type: none;
    padding: 0;
}

li {
    background-color: #f9f9f9;
    margin: 5px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#todoList li {
    justify-content: space-around;
    flex-wrap: wrap;
    row-gap: 1em;
}
.todoContent {
    min-width: 50%;
}

#log-list li * {
	width: 33%;
}

li button {
    margin-left: 10px;
}

.duedate {
    margin-left: auto;
    margin-right: 1em;
    min-width: 5em;
}
.overdue {
    color: red; /* Red color for overdue dates */
    font-weight: bold; /* Bold text for overdue dates */
}


/* Modal styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Black background with transparency */
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    width: max(35em, 50%); /* Half of the screen width */
    max-width: 100%;
    border-radius: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    cursor: pointer;
}

/* Form styling */
form {
    display: flex;
    flex-direction: column;
}

form label {
    margin: 10px 0 5px;
    font-weight: bold;
}

form input {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

form button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

form button:hover {
    background-color: #45a049;
}

#stats-section {
    margin-top: 20px;
    padding: 10px;
    background-color: #f4f4f4;
    border-radius: 8px;
    max-height: 40vh;
}
#log-scroll {
    flex-direction: column-reverse;
    display: flex;
    overflow-y: auto;
    max-height: 40vh;
    margin-top: 20px;
    padding: 10px;
    background-color: #f4f4f4;
    border-radius: 8px;
}

#stats-section li {
    margin: 5px 0;
    font-size: 1.1em;
}

#log-list li {
    margin: 5px 0;
}

.modal .content {
	overflow: auto;
	max-height: 30em;
	display: flex;
	justify-content: space-evenly;
}
.modal .content li {
  padding: 1em 3vw;
}

/* Further options dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 10em;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.dropdown-menu button {
  color: black;
  padding: 8px 16px;
  text-decoration: none;
  display: block;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

@media (min-width: 768px) {
  .dropdown:hover .dropdown-menu {
    display: block;
  }
}

.toggle-container {
    display: flex;
    align-items: center;
    position: relative;
    width: 30em;
    background: #ddd;
    border-radius: 25px;
}

.toggle-container input {
    display: none;
}

.toggle-label {
    flex: 1;
    text-align: center;
    cursor: pointer;
    padding: 5px 0;
    transition: color 0.3s ease;
    z-index: 1;
}

.toggle-label:hover {
    color: #555;
}

.slider {
    position: absolute;
    width: calc( 30em / 3 - 3px );
    height: 30px;
    background: #4caf50;
    border-radius: 15px;
    transition: transform 0.3s ease;
    margin: 4px;
}

#radioRecurring:checked ~ .slider {
    transform: translateX(0);
}

#radioOnetime:checked ~ .slider {
    transform: translateX(100%);
}

#radioOnDemand:checked ~ .slider {
    transform: translateX(200%);
}

/* Tag buttons */
.tag-button {
    border-radius: 20px;
    padding: 5px 15px;
    margin: 5px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
    color: #000;
}
.tag-button.active {
    background-color: #007BFF;
    color: #fff;
}

select {
    border-radius: 20px;
    padding: 5px 15px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
    color: #000;
    font-size: 16px;
}


/* Shopping */
#addShoppingArticle {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: stretch;
    padding-top: 1em;
    flex-wrap: wrap;
}
#shoppingDesc {
    flex-grow: 2;
}
#shopping span {
	flex-grow: 2;
	padding: 0 1em;
}

/* Logout & notification */
#user-info {
  position: absolute;
  top: 0;
  right: 0;
}
#user-info button {
  background-color: #888;
}
#user-info button:hover {
  background-color: black;
  color: #eee;
}

/* Emoji */
#emoji {
  position: fixed;
  top: 50%;
  left: 50%;
  font-size: 80vmin;
  color: #0009;
  transform: translate(-50%, -50%) scale(0.5);
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;;
}

.visible {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1) !important;
}
