:root {
    --primary-color: #6c5ce7;
    /* Soft Purple */
    --primary-dark: #5a4bcf;
    --secondary-color: #b2bec3;
    --bg-color: #dfe6e9;
    /* Light Grey Blue */
    --card-bg: #ffffff;
    --text-color: #2d3436;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --danger: #ff7675;
    --success: #55efc4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    /* Keep a nice font */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 20px;
    min-height: 100vh;
}

.app-container {
    max-width: 800px;
    margin: 40px auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f2f6;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

h1 {
    font-size: 28px;
    color: var(--primary-color);
}

h1 span {
    color: var(--text-color);
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    margin-left: 20px;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.action-bar {
    display: flex;
    justify-content: flex-end;
    /* Align buttons to right */
    gap: 15px;
    margin-bottom: 30px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #d63031;
}

.btn-secondary {
    background-color: #f1f2f6;
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #e1e2e6;
}

.btn-edit {
    background-color: #ffeaa7;
    color: #d35400;
}

.btn-edit:hover {
    background-color: #fdcb6e;
}

/* Task List */
.task-sections h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid #f1f2f6;
    /* Subtle border */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Align to top for multiline desc */
    transition: transform 0.2s;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.task-info {
    flex: 1;
}

.task-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: var(--text-color);
}

.task-desc {
    font-size: 14px;
    color: #636e72;
    margin-bottom: 10px;
    white-space: pre-wrap;
    /* Preserve line breaks */
}

.task-meta {
    font-size: 12px;
    color: var(--secondary-color);
    display: flex;
    gap: 15px;
}

.task-actions {
    display: flex;
    gap: 8px;
    margin-left: 15px;
}

.task-actions button {
    padding: 8px;
    /* Smaller icon buttons */
    border-radius: 50%;
    /* Circle buttons */
    width: 35px;
    height: 35px;
    justify-content: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 52, 54, 0.6);
    /* Darker overlay */
    backdrop-filter: blur(4px);
    /* Blur behind modal */
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: none;
}

.close-btn {
    background: none;
    font-size: 24px;
    color: var(--secondary-color);
    padding: 0;
}

.close-btn:hover {
    color: var(--danger);
    transform: none;
}

/* Inputs */
input,
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 2px solid #f1f2f6;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* History Table */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    /* Space between rows */
    margin-top: 10px;
}

th {
    text-align: left;
    padding: 15px;
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

td {
    background: white;
    padding: 15px;
}

tr td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

tr td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}