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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    opacity: 0.9;
    font-size: 1rem;
}

/* Main Content */
main {
    padding: 2rem;
}

/* Form Section */
.form-section {
    margin-bottom: 2rem;
}

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

#name {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#name:focus {
    outline: none;
    border-color: #4b6cb7;
}

#submitBtn {
    background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

#submitBtn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.form-hint {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* Stats Section */
.stats-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #4b6cb7;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.clear-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clear-btn:hover {
    background-color: #ff5252;
}

/* List Section */
.list-section h2 {
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4b6cb7;
    transition: transform 0.2s, box-shadow 0.2s;
}

.todo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.todo-content {
    flex: 1;
    font-size: 1.1rem;
    word-break: break-word;
}

.todo-actions {
    display: flex;
    gap: 8px;
}

.todo-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.todo-btn:hover {
    opacity: 0.8;
}

.update-btn {
    background-color: #4CAF50;
    color: white;
}

.delete-btn {
    background-color: #f44336;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-style: italic;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

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

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.btn-danger {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
}

.btn-secondary {
    background-color: #757575;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .todo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .todo-actions {
        align-self: flex-end;
    }
}