:root {
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text: #333;
    --gray: #888;
    --border: #e5e5e5;
    --sidebar-bg: #fff;
    --sidebar-width: 250px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

.app-wrapper {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary);
}

#add-list-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#lists-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

#lists-nav li {
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

#lists-nav li:hover {
    background: #f9fafb;
}

#lists-nav li.active {
    background: #eff6ff;
    border-right: 3px solid var(--primary);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    padding-top: 50px;
    overflow-y: auto;
}

.container {
    background: var(--card-bg);
    width: 90%;
    max-width: 600px;
    height: fit-content;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 2rem;
}

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

h1 {
    color: var(--text);
    margin: 0;
    font-size: 1.8rem;
}

.delete-list-btn {
    background: transparent;
    color: #ef4444;
    font-size: 0.9rem;
    padding: 5px 10px;
    border: 1px solid #fee2e2;
}

.delete-list-btn:hover {
    background: #fee2e2;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    border-color: var(--primary);
}

button#add-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

button#add-btn:hover {
    background-color: var(--primary-hover);
}

ul#todo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul#todo-list li {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
}

ul#todo-list li:last-child {
    border-bottom: none;
}

ul#todo-list li.completed span {
    text-decoration: line-through;
    color: var(--gray);
}

ul#todo-list input[type="checkbox"] {
    margin-right: 15px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

span.task-text {
    flex: 1;
    font-size: 1.1rem;
    cursor: pointer;
}

button.delete-todo-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    padding: 5px;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

ul#todo-list li:hover button.delete-todo-btn {
    opacity: 1;
}

button.delete-todo-btn:hover {
    background: #fee2e2;
    border-radius: 4px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--gray);
}

#clear-completed {
    background: transparent;
    color: var(--gray);
    font-weight: normal;
    padding: 5px 10px;
    border: none;
    cursor: pointer;
}

#clear-completed:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
}

.modal-content h3 { margin-top: 0; }

.modal-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-actions button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

#cancel-list-btn { background: #e5e5e5; }
#save-list-btn { background: var(--primary); color: white; }

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