@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #5d5d81;
    --secondary-color: #8c7aea;
    --bg-color: #f4f6f9;
    --card-bg-color: #ffffff;
    --text-color: #333;
    --light-text-color: #777;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    padding: 20px;
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: auto;
    background-color: var(--card-bg-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px var(--shadow-color);
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 25px;
}

/* Input Section */
.input-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

#taskNameInput, #subjectInput, #deadlineInput {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 150px;
    transition: border-color 0.3s;
}

#taskNameInput:focus, #subjectInput:focus, #deadlineInput:focus {
    outline: none;
    border-color: var(--secondary-color);
}

#addTaskBtn {
    padding: 12px 25px;
    border: none;
    background-color: var(--secondary-color);
    color: var(--card-bg-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

#addTaskBtn:hover {
    background-color: #7361c4;
}

/* Stats Section */
.stats-section {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background-color: #eef1f6;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    flex: 1;
}

.stat-card h3 {
    margin: 0 0 5px;
    font-size: 1rem;
    color: var(--light-text-color);
}

.stat-card p {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Progress Bar */
.progress-bar-container {
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 15px;
    margin-bottom: 25px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--secondary-color);
    transition: width 0.4s ease-in-out;
    border-radius: 10px;
}

/* Tasks Header & Controls */
.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 5px;
    margin-top: 25px;
    margin-bottom: 20px;
}

.tasks-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.filter-sort-controls {
    display: flex;
    gap: 10px;
}

#filterDropdown, #sortDropdown {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* Task List */
#taskList {
    list-style: none;
    padding: 0;
}

.task-item {
    background-color: #f9f9f9;
    border-left: 5px solid var(--secondary-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.task-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.task-item.completed {
    border-left-color: #28a745;
    background-color: #eaf6ea;
    opacity: 0.8;
}

.task-item-info h3 {
    margin: 0 0 5px;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.task-item-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--light-text-color);
}

.task-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 8px;
    transition: color 0.3s;
}

.task-actions .complete-btn { color: #28a745; }
.task-actions .edit-btn { color: #ffc107; }
.task-actions .delete-btn { color: #dc3545; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--card-bg-color);
    margin: 15% auto;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    animation-name: animatetop;
    animation-duration: 0.4s;
}

@keyframes animatetop {
    from { top: -300px; opacity: 0; }
    to { top: 0; opacity: 1; }
}

.close-btn {
    color: var(--light-text-color);
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover, .close-btn:focus {
    color: var(--text-color);
}

.modal-content h2 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 5px;
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

#saveEditBtn {
    width: 100%;
    padding: 12px;
    border: none;
    background-color: var(--secondary-color);
    color: var(--card-bg-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

#saveEditBtn:hover {
    background-color: #7361c4;
}