/* General Body Styles */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

/* Main Application Container */
.app-container {
    width: 100%;
    max-width: 600px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 30px;
    box-sizing: border-box;
}

header {
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

header h1 {
    margin: 0;
    color: #2c3e50;
    font-weight: 700;
}

header p {
    margin: 5px 0 0;
    color: #7f8c8d;
}

/* Task Input Form */
#task-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#task-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

#task-input:focus {
    outline: none;
    border-color: #3498db;
}

.task-options {
    display: flex;
    gap: 15px;
}

#priority-select {
    flex-grow: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    font-size: 16px;
    cursor: pointer;
}

#add-task-btn {
    padding: 12px 25px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

#add-task-btn:hover {
    background-color: #2980b9;
}

/* Task List Styles */
.task-list-container h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-top: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#task-list, #archived-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 20px; /* For better drop experience on empty lists */
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    background-color: #ecf0f1;
    transition: background-color 0.3s, opacity 0.4s;
    animation: fadeIn 0.5s ease-in-out;
    cursor: grab; /* Indicates the item is draggable */
}

.task-item.dragging {
    opacity: 0.5;
    background-color: #bdc3c7;
}

.task-item.removing {
    animation: fadeOut 0.5s ease-in-out forwards;
}

.task-item.done .task-text {
    text-decoration: line-through;
    color: #95a5a6;
}

.task-text {
    flex-grow: 1;
    margin: 0 15px;
}

/* Priority Color Coding */
.task-item[data-priority="low"] { border-left: 5px solid #2ecc71; }
.task-item[data-priority="medium"] { border-left: 5px solid #f1c40f; }
.task-item[data-priority="high"] { border-left: 5px solid #e74c3c; }

.task-buttons button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    margin-left: 10px;
    transition: color 0.3s;
}

.done-btn { color: #27ae60; }
.done-btn:hover { color: #2ecc71; }

.archive-btn { color: #8e44ad; }
.archive-btn:hover { color: #9b59b6; }

.delete-btn { color: #c0392b; }
.delete-btn:hover { color: #e74c3c; }

/* Archive Section */
#archive-container.hidden #archived-task-list {
    display: none;
}
.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#toggle-archive-btn {
    padding: 5px 15px;
    background-color: #7f8c8d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}
#toggle-archive-btn:hover {
    background-color: #95a5a6;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

/* Responsive Design */
@media (max-width: 480px) {
    body { padding: 10px; }
    .app-container { padding: 20px; }
    .task-options { flex-direction: column; }
}