:root {
    --primary: #6c5ce7;
    --primary-dark: #5d4de0;
    --secondary: #00cec9;
    --success: #00b894;
    --danger: #ff7675;
    --warning: #fdcb6e;
    --dark: #2d3436;
    --light: #f7f7f7;
    --gray: #ddd;
    --border: #e0e0e0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 10px;
}

.dark-mode {
    --dark: #f7f7f7;
    --light: #2d3436;
    --gray: #4a4a4a;
    --border: #555;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s, color 0.3s;
}

.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--light);
}

.app-container {
    width: 100%;
    max-width: 700px;
    margin: 20px auto;
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: background 0.3s;
}

.dark-mode .app-container {
    background-color: #1e1e2d;
}

header {
    background: var(--primary);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.dark-mode header {
    background: #5d4de0;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.subtitle {
    font-weight: 300;
    opacity: 0.9;
}

.controls {
    display: flex;
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border);
}

.dark-mode .controls {
    background-color: #252538;
    border-bottom: 1px solid var(--border);
}

.search-container {
    flex: 1;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 1rem;
    background-color: var(--light);
    color: var(--dark);
}

.dark-mode .search-container input {
    background-color: #2d2d44;
    border: 1px solid var(--border);
    color: var(--light);
}

.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-mode .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.input-container {
    position: relative;
    padding: 15px;
    background-color: #f8f9fa;
    display: flex;
    gap: 10px;
}

.dark-mode .input-container {
    background-color: #252538;
}

.input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 1rem;
    background-color: var(--light);
    color: var(--dark);
}

.dark-mode .input {
    background-color: #2d2d44;
    border: 1px solid var(--border);
    color: var(--light);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
}

.add-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.filters {
    display: flex;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border);
    gap: 10px;
    flex-wrap: wrap;
}

.dark-mode .filters {
    background-color: #252538;
    border-bottom: 1px solid var(--border);
}

.filter-btn {
    padding: 6px 15px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.dark-mode .filter-btn {
    background: #2d2d44;
    color: var(--light);
    border: 1px solid var(--border);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.priority-selector {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.priority-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.priority-btn.high { background-color: var(--danger); }
.priority-btn.medium { background-color: var(--warning); }
.priority-btn.low { background-color: var(--success); }

.priority-btn.active {
    box-shadow: 0 0 0 3px white, 0 0 0 4px #666;
}

.dark-mode .priority-btn.active {
    box-shadow: 0 0 0 3px #2d2d44, 0 0 0 4px #666;
}

.todos {
    list-style-type: none;
    max-height: 400px;
    overflow-y: auto;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
    transition: background 0.3s;
}

.dark-mode .todo-item {
    border-bottom: 1px solid var(--border);
}

.todo-item:hover {
    background-color: #f8f9fa;
}

.dark-mode .todo-item:hover {
    background-color: #252538;
}

.todo-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.todo-checkbox.checked {
    background-color: var(--success);
    border-color: var(--success);
}

.todo-checkbox.checked i {
    display: block;
    color: white;
}

.todo-checkbox i {
    display: none;
}

.todo-content {
    flex: 1;
}

.todo-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.todo-meta {
    display: flex;
    font-size: 0.8rem;
    color: #777;
    gap: 15px;
}

.dark-mode .todo-meta {
    color: #aaa;
}

.priority-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
}

.priority-high { background-color: rgba(255, 118, 117, 0.2); color: var(--danger); }
.priority-medium { background-color: rgba(253, 203, 110, 0.2); color: #d6a20c; }
.priority-low { background-color: rgba(0, 184, 148, 0.2); color: var(--success); }

.due-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.delete-btn {
    background: none;
    border: none;
    color: #ff7675;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.3s;
    margin-left: 10px;
}

.delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.stats {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.dark-mode .stats {
    background-color: #252538;
    border-top: 1px solid var(--border);
}

.progress-container {
    margin-top: 10px;
}

.progress-bar {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.dark-mode .progress-bar {
    background-color: #3a3a52;
}

.progress {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #777;
}

.dark-mode .empty-state {
    color: #aaa;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state p {
    margin: 0;
    font-size: 1.2rem;
}

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

@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .filters {
        justify-content: center;
    }
    
    .priority-selector {
        margin-left: 0;
        margin-top: 10px;
    }
}