:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #4fc3f7;
    --danger-color: #f44336;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --low-priority: #8bc34a;
    --medium-priority: #ffc107;
    --high-priority: #f44336;
    --text-color: #333;
    --light-text: #777;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--light-text);
    font-size: 0.9rem;
}

.input-section {
    margin-bottom: 20px;
}

#task-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#task-form input, #task-form select {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    flex: 1;
    min-width: 150px;
}

#task-input {
    flex: 3;
}

#task-form button {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

#task-form button:hover {
    background-color: var(--secondary-color);
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.controls button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #f0f0f0;
    transition: all 0.3s;
}

.controls button:hover {
    background-color: #e0e0e0;
}

.controls button.active {
    background-color: var(--primary-color);
    color: white;
}

#clear-completed, #clear-all {
    background-color: #f8d7da;
    color: var(--danger-color);
}

#clear-completed:hover, #clear-all:hover {
    background-color: #f1b0b7;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-text);
}

#search-input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

#task-list {
    list-style: none;
    margin-bottom: 20px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.task-item.low-priority {
    border-left-color: var(--low-priority);
}

.task-item.medium-priority {
    border-left-color: var(--medium-priority);
}

.task-item.high-priority {
    border-left-color: var(--high-priority);
}

.task-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.task-text {
    flex: 1;
    word-break: break-word;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--light-text);
}

.task-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--light-text);
}

.task-priority {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

.task-priority.low {
    background-color: rgba(139, 195, 74, 0.1);
    color: var(--low-priority);
}

.task-priority.medium {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--medium-priority);
}

.task-priority.high {
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--high-priority);
}

.task-actions {
    display: flex;
    gap: 10px;
}

.task-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--light-text);
    transition: color 0.3s;
    font-size: 1rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.task-actions button:hover {
    background-color: #f0f0f0;
}

.task-actions .edit-btn:hover {
    color: var(--primary-color);
}

.task-actions .delete-btn:hover {
    color: var(--danger-color);
}

.sort-options {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
}

.sort-options select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: white;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background-color: var(--success-color);
    color: white;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    #task-form {
        flex-direction: column;
    }
    
    #task-form input, #task-form select, #task-form button {
        width: 100%;
    }
    
    .controls {
        justify-content: center;
    }
}