body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #4facfe, #00f2fe, #43e97b, #f8ffae);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;

    /* Flexbox for centering */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.todo-wrapper {
    display: flex;
    align-items: center;
    min-height: 100vh;
}

/* Animation */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.todo-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    width: 350px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    animation: fadeIn 0.5s ease-in-out;
}

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

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#task-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: 0.2s;
}

#task-input:focus {
    border-color: #4facfe;
}

#add-task-btn {
    padding: 10px 15px;
    background: #4facfe;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

#add-task-btn:hover {
    background: #3a91f8;
}

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

li {
    background: #f9f9f9;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
    animation: slideIn 0.3s ease;
}

li.completed span {
    text-decoration: line-through;
    color: gray;
}

span {
    flex: 1;
    word-break: break-word;
}

.complete-btn {
    background: #21d4fd;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 5px;
    transition: background 0.2s;
}

.complete-btn:hover {
    background: #0bb3e4;
}

.delete-btn {
    background: #ff5f6d;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.delete-btn:hover {
    background: #e04855;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#completed-section {
    margin-top: 20px;
}

#toggle-completed-btn {
    background: #666;
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    transition: background 0.2s;
}

#toggle-completed-btn:hover {
    background: #555;
}

#completed-task-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.3s ease;
}

#completed-task-list.show {
    max-height: 500px; /* Large enough to fit many tasks */
    padding-top: 10px;
}

/* Title + button layout */
.title-section {
    text-align: center;
    margin-bottom: 15px;
}

#change-title-btn {
    background: #ff9800;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

#change-title-btn:hover {
    background: #e68900;
}

#todo-title[contenteditable="true"] {
    cursor: text;
    border: 2px dashed transparent;
    padding: 4px;
    transition: border-color 0.2s;
}

#todo-title[contenteditable="true"]:focus {
    outline: none;
    border-color: #4facfe;
    background: #f0f8ff;
    border-radius: 8px;
}

#todo-title {
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
}

/* Smooth task movement animation */
li {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

li.moving {
    transform: translateY(10px);
    opacity: 0;
}

/* Fade-in effect for new tasks */
li.new-task {
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

li.new-task.show {
    opacity: 1;
    transform: translateY(0);
}

.todo-wrapper {
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.todo-container {
    background: rgba(255, 255, 255, 0.8); /* white with 80% opacity */
    border: 2px solid white;               /* white outline */
    padding: 20px;
    border-radius: 15px;
    width: 350px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    animation: fadeIn 0.5s ease-in-out;
    backdrop-filter: blur(10px);           /* optional: nice blur effect behind */
}