* {
    scroll-behavior: smooth;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    min-height: 100%; 
    box-sizing: border-box;
}

.container {
    background-color: #ffffff2a;
    backdrop-filter: blur(10px);
    margin: 50px 20px;
    padding: 30px;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgb(243, 243, 243);
    width: 100%;
    max-width: 500px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
}


#todo-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    object-fit: cover;
}

#todo-input,
#date-input,
#todo-form button {
    max-width: 100%;
    flex-grow: 1; 
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px; 
}

#todo-form button {
    background-color: #28a745; 
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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


.filters {
    border: 1px solid #ddd;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

#all-btn,
#active-btn,
#completed-btn {
    flex-grow: 1;
}

.filters button {
    padding: 10px 18px;
    border: 1px solid #007bff;
    background-color: #fff;
    color: #007bff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
}

.filters button:hover {
    background-color: #e7f3ff; 
    color: #0056b3;
    border-color: #0056b3;
}

.filters button.active {
    background-color: #007bff; 
    color: white;
    border-color: #007bff;
}


#todo-list {
    list-style: none; 
    padding: 0;
    margin: 0;
}

#todo-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f9f9f9;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.2s ease;
    flex-wrap: wrap; 
}

#todo-list li.completed {
    text-decoration: line-through; 
    color: #888;
    background-color: #e9e9e9;
}

#todo-list li:hover {
    background-color: #f0f0f0;
}

.task-info {
    flex-grow: 1; 
    margin-right: 10px;
    display: flex;
    flex-direction: column;
}

.task-info span.task-name {
    font-weight: bold;
    color: #333;
    word-break: break-word;
}

.task-info span.task-date {
    font-size: 0.9em;
    color: #666;
    margin-top: 3px;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.actions button {
    flex-grow: 1;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.actions .complete-btn {
    background-color: #ffc107; 
    color: #333;
}

.actions .complete-btn:hover {
    background-color: #e0a800; 
}

.actions .delete-btn {
    background-color: #dc3545; 
    color: white;
}

.actions .delete-btn:hover {
    background-color: #c82333; 
}

/* Gambar acak */

.floating-images {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.floating-images img {
  position: absolute;
  animation: floatDown linear infinite;
  will-change: transform, opacity;
  opacity: 0;
}

@keyframes floatDown {
  0% {
    transform: translate3d(0, -100px, 0) rotate(0deg);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 100vh, 0) rotate(360deg);
    opacity: 0;
  }
}


/* Responsive */
@media (max-width: 600px) {
    #todo-form {
        flex-direction: column;
    }

    .filters {
        flex-direction: column;
        align-items: center;
    }

    .filters button {
        width: 100%;
        margin-bottom: 5px;
    }

    #todo-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .task-info {
        width: 100%;
        margin-right: 0;
    }

    .actions {
        width: 100%;
        justify-content: flex-end;
    }
}