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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Login */
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 80px;
    text-align: center;
}

.login-box h1 {
    margin-bottom: 24px;
    font-size: 28px;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.login-box button:hover {
    background: #555;
}

.error {
    color: #d32f2f;
    margin-bottom: 16px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 28px;
}

.logout {
    color: #666;
    text-decoration: none;
}

.logout:hover {
    color: #333;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab {
    padding: 8px 16px;
    background: #eee;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.tab:hover {
    background: #ddd;
}

.tab.active {
    background: #333;
    color: #fff;
}

/* Add form */
#add-form {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

#add-form input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#add-form button {
    padding: 12px 24px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

#add-form button:hover {
    background: #555;
}

/* Todo list */
#todo-list {
    list-style: none;
}

.todo-item {
    background: #fff;
    border-radius: 4px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.todo-main {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 12px;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.todo-title {
    flex: 1;
    font-size: 16px;
    cursor: pointer;
}

.todo-title:hover {
    color: #666;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: #999;
}

.todo-archive,
.todo-restore {
    background: none;
    border: 1px solid #ddd;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
}

.todo-archive:hover {
    background: #f5f5f5;
    color: #333;
}

.todo-restore:hover {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.todo-details {
    padding: 0 12px 12px 44px;
    color: #666;
    font-size: 14px;
    white-space: pre-wrap;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 16px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

.timestamp {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

#save-btn {
    background: #333;
    color: #fff;
}

#save-btn:hover {
    background: #555;
}

.secondary {
    background: #eee;
    color: #333;
}

.secondary:hover {
    background: #ddd;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    .login-box {
        padding: 24px;
        margin-top: 40px;
    }

    #add-form {
        flex-direction: column;
    }

    #add-form button {
        width: 100%;
    }
}
